The full name of AOP is Aspect-oriented programming, which is the core idea of Aspect-Oriented Programming.
AOP is an object-oriented programming language that does not conflict with each other. They are complementary design models.
Spring containers do not depend on AOP. The goal is not to provide the latest AOP implementation. It focuses on providing close integration between AOP implementation and springioc to solve common problems.
AOP terminology
Cross-cutting concern: service on the system layer is interspersed into the processing process of business logic.
Aspect (aspect): Apply the cross .. integrated into an independent reusable object, put it on the application when needed. If not needed, it is detached from the application, and the application intrusion is small.
Advice (notification): the specific implementation of aspect, including cross behavior or services provided
Joinpoint: aspect can insert a cut point during application execution. This point can be used when a method is called, an exception is thrown, or even when a field is compiled, the Section code can insert these points into the general process of the program to add new behaviors.
Poincut: Specifies an aspect that is interspersed with applications at those joinpoints.
Target: the object to be notified.
Introduction
Weave (woven): The process above the application object, three stages, compilation, class loading, starting from execution
Spring supports pointcut and aspect for AOP. And how to add weave to the application. The interface should be implemented first to reduce coupling.
Written in pure Java language
You can use the configuration file to define pintcuts.
Jointpoints of attribute members is not supported. Destruction encapsulation type
Spring creates advice as input
Frontend notification before advice
Call the method of the target object before executing it.
Implement the methodbeforeadvice interface. The before method is called and executed before the method specified by the target object is executed.
Frontend notification before advice