[Spring] Aspect oriented Programming with Spring | AOP | Facets | Pointcut

Source: Internet
Author: User

Programming with spring-oriented facets

1. Introduction

AOP is a complement to OOP and provides another way of thinking about the structure of the program.

The modular key unit of OOP is the class.

AOP is the aspect facet.

AOP divides the logic of the program into separate blocks (called concern center of gravity, Focus point).

AOP is used to increase the modularity of the cross-cutting center of gravity (cross-cutting concerns).

A cross-cutting concern is a concern that can affect the entire program, and should be centered as much as possible in a certain location of the code.

For example: Transaction management, Authorization, login, log, security and so on.

2. Why Use AOP

Provides a pluggable method to dynamically add additional concern:before,after or around logic blocks.

The portal of the AOP is in the XML file.

3. Where to use AOP

In the following scenario:

    • To provide declarative enterprise services such as declarative transaction management.
    • It allows users to implement custom aspects.

4.AOP Concepts and terminology

    • Join Point
    • Advice
    • Pointcut
    • Introduction
    • Target Object
    • Aspect
    • Interceptor
    • AOP Proxy
    • Weaving

4.1 Join Point

Spring only provides methods to execute an access point.

4.2 Advice

[Spring] Aspect oriented Programming with Spring | AOP | Facets | Pointcut

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.