Section-oriented programming
What is Aspect oriented programming? Aspect oriented programming is a programming paradigm, not a programming language, used to solve specific problems that complement OOP. Solve code duplication, separation of concerns, separation of facets, and separation of business functional requirements from non-functional requirements. Usage scenario: Permission control Cache control Transaction control Audit log performance monitoring Distributed tracing
Use of Spring AOP in detail
Spring AOP has two main parts: where to intercept and when to intercept; Includes Pointcut Express, 5 types of Advice
Implementation principles of Spring AOP
It mainly involves two parts, one is the design of the use of Proxy mode and responsibility chain mode, the other is the implementation of JDK implementation and Cglib implementation JDK implementation: class: java.lang.reflect.proxy interface: The InvocationHandler can only compare the dynamic proxy JDK with the Cglib proxy based on the interface: The JDK can dynamically proxy only interface methods that have interface classes. Cglib implements proxies based on inheritance, and does not implement proxies for private and static methods. At this point, the chain of responsibility mode is used for processing