1, Connection point (Joinpoint):
A connection point is a specific point at which a slice can be inserted during program execution. The point can be when the method is called, when an exception is thrown, or even when the field is modified,
For spring, only method connection points are supported.
2. Tangent point (Pointcut):
A class has many methods, all of which are connection points, but not every method has to be inserted into a slice, so it is necessary to filter by certain conditions, which
The method to insert a slice after filtering is called a tangent, so the tangent point consists of a single live multiple connection points, which is a subset of the connection point collection.
3. Notice (Advice):
The work to be done by a slice is called a notification, and it is understood as "when" and "what" to do when it defines a pre-tangent (before) or a tangent (after).
Spring has 5 types of notifications:
①before: Pre-notification, executed before the tangent method.
②after: A post notification, which is notified after the tangent method returns, regardless of whether the method was executed successfully.
③after-returning: Notify after return, call notification after the Tangency method executes successfully.
④after-throwing: Notifies after a throw is thrown, and a notification is invoked after the Pointcut method throws an exception.
⑤arount: Surround notification, which invokes the notification both before the method call and after the method call. And can decide whether this method executes, when to execute.
4. Facets ( Aspect):
The combination of a notification and a tangent point is a tangent.
5. Introduction (Introduction):
The introduction is to add new methods and properties to a class so that they have new behaviors and properties without changing existing classes.
6. Weave in ( Weaving ):
Weaving is the process by which facets are applied to the target object, and multiple points can be woven into the target object's running cycle.
① compile time: weaving when the tangent target class is compiled. ASPECTJ is the compile-time weaving.
② class loading period: The tangent target class is loaded into the JVM that is weaving.
③ Runtime: Slices are woven at some point in the run, and Spring AOP is woven in this way, and the AOP container creates a proxy object dynamically for the target object.
Spring aspect-oriented programming (i) AOP terminology