Spring (AOP, agent-based AOP implementation, automatic proxy AOP implementation, based on aspectjaop[annotations)

Source: Internet
Author: User

----------------AOP------------------

----------------------Agent-based AOP implementation-------------------------------------

1. Create an interface class to implement the class

2. Introduce spring support, tick the AOP support

3. Create the Bean for the implementation class, the Bean for the proxy class

4. Create a proxy class and implement two interfaces

5. Defining pointcuts

6. Define notifications (bind an agent), advice---> Proxy classes, pointcut-----> pointcuts

7. Define the Agent factory

Target---> targets (Implementation Class)

Interceptornames----> Interceptor name (Notification)

Proxyinterfaces----> Agent Interface (interface package name)

8. Testing

--------------------------------Automatic proxy AOP implementation---------------------

1. No need to define pointcut bean, notify Bean, factory bean

Whenever you define a notification that supports regular expressions and supports automatic proxy beans

Advice---> proxy class,

Pattern----> Regular expression packages, filtering methods

Modify the test class to change the bean to an interface implementation class

-------------------------------implementation---------------------based on ASPECTJAOP

1. Add support for annotations, increase support for AOP, and declare ASPECTJ support

Just implement the class bean

2. Write the slice class, the ordinary class does not implement any interface

Execution content is too long or

3. Testing

Spring (AOP, agent-based AOP implementation, automatic proxy AOP implementation, based on aspectjaop[annotations)

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.