IOC and AOP for spring framework

Source: Internet
Author: User

For:

IoC: Inversion of control, in today's development, if you want to set up an object and attribute it, you need to start with a new object and set the property by setter or constructor method. When using the spring IOC, the configured properties are set automatically by configuring the values or relationships of the declared properties and then building the objects through the spring framework. This feature can replace the factory class. A Di (Dependency injection) is also proposed in the IOC, which means that a class configured in spring is set to another spring-configured class, and is used as an attribute. The principle of implementation is still to use reflection, which is still to establish the object before setting the property. The disadvantage of the factory class is that it is necessary to add a method to write an implementation class. , which is the disadvantage of propaganda. The downside of spring is that Java classes can be used without writing, but the configuration file is rather more.

AOP: Aspect-oriented programming, characterized by adding a new feature to the project without modifying the original code. The filter filter is a typical AOP design. Spring is the function of using the Interceptor interceptor to implement dynamic Proxy design//proxy refers to the proxy design pattern, one of the 23 design patterns in Java. The main implementation here is the closure of the connection, as well as the transaction commit and rollback operations, the use of this AOP function, the service implementation class will no longer need to write their own try...catch...finallly and other operations, by spring automatic completion.

IOC and AOP for spring framework

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.