It is the proxy pattern that made Spring AOP able to decouple crosscutting concerns from the core application's business logic or functionalities. The proxy pattern is a structural design pattern included in a book by the Gang of Four (GoF). In practice, the proxy pattern creates different object wrapping out of an original object without changing the behavior of the original object to allow intercepting its method call, and the outside world would feel they are interacting with the original object and not a proxy.
AOP proxies
JDK dynamic proxies and CGLIB proxies
The proxy in Spring AOP can be created in two ways:
- JDK proxy (dynamic proxy): The JDK proxy creates a new proxy object by implementing interfaces of the target...