Introduction to Spring (9) AOP for AOP programming

Source: Internet
Author: User
Tags aop requires

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.

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.