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