AOP of spring (11)

A key component of the spring framework is the aspect oriented programming (AOP) framework. Aspect oriented programming needs to decompose the program logic into different parts, which is called the so-called concern. Functions that span multiple points of an application are called crosscutting concerns, which are conceptually independent of the application's business logic. There are a variety of common good examples, such as logging, auditing, declarative transactions, security, caching, and so on.

In OOP, the key unit modularity is class, while in AOP, unit modularity is aspect. Dependency injection helps you decouple application objects from each other and AOP helps you decouple crosscutting concerns from the objects they affect. AOP is a trigger like programming languages, such as Perl Net, Java or other.

The spring AOP module provides interceptors to intercept an application. For example, when a method is executed, you can add additional functions before or after the method is executed.

AOP Based XML Schema in spring

Example:

(1) Write logging java

(2) Write student java

(3) Write mainapp java

(4) Write beans xml

(5) Run mainapp Main method in Java

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>