Aspect-Oriented Programming of Spring AOP (42)

Source: Internet
Author: User

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

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.