AOP Aspect Oriented Programming

1. JDK dynamic proxy

The JDK dynamic proxy is implemented through the java.lang.reflect.Proxy class. We can call the newProxyInstance() method of the Proxy class to create a proxy object.

For classes that use business interfaces, Spring will use JDK dynamic proxy to implement AOP by default.

2. CGLIB agent

If you want to proxy a class that does not implement an interface, you can use a CGLIB proxy.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325941719&siteId=291194637