What exactly is AOP?
AOP is the abbreviation of Aspect oriented programming, meaning: face-oriented programming (also called aspect-oriented), through the precompilation and runtime dynamic Agent to achieve the program without modifying the source code for dynamic Unified Add function of a technology. AOP is actually a continuation of the GOF design pattern, and the design pattern tirelessly pursues the decoupling between the caller and the callee, which can be said to be an implementation of this goal.
Defining AOP Terminology
1. Slice (aspect): To achieve the cross function, is the system of a modular section or field. such as Log records.
2. Connection point: The location where the slice is inserted during application execution, either a method call, an exception is thrown, or a field to modify.
3. Notice: The actual implementation of the cut, he informs the system of new behavior. such as in the log notification contains the implementation of the log function code, such as log to log files. The notification is inserted into the application system at the connection point.
4. Pointcut: Defines which connection points the notification should be applied to, and notifies you of any connection points that the AOP framework supports.
5. Introduction: Add new methods and properties to the class.
6. Target object: The object being notified. It can be either a class that you write or a third party class.
7. Agent: Objects created after the notification is applied to the target object, and other parts of the application system do not need to be changed to support the proxy object.
8. Weaving: The process of applying a slice to a target object to create a new proxy object. Weaving occurs on multiple points in the life cycle of the target object:
Compile Date: The slice is woven into the target object at compile time. This requires a special compiler.
Class load period: The slice is woven when the target object is loaded into the JVM. This requires a special class loader.
Operation period: The slice is woven into the application system when it is running.