> For the complete documentation index, see [llms.txt](https://doc.shiker.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.shiker.tech/spring-he-xin-gong-neng/5.-spring-mian-xiang-qie-mian-bian-cheng/5.3.-aop-dai-li.md).

# 5.3. AOP 代理

Spring AOP 默认为 AOP 代理使用标准 JDK 动态代理。这使得任何接口（或一组接口）都可以被代理。

Spring AOP 也可以使用 CGLIB 代理。这是代理类而不是接口所必需的。默认情况下，如果业务对象未实现接口，则使用 CGLIB。由于对接口而不是类进行编程是一种很好的做法，因此业务类通常实现一个或多个业务接口。在那些（希望很少见）需要通知未在接口上声明的方法或需要将代理对象作为具体类型传递给方法的情况下，可以 [强制使用 CGLIB 。](https://docs.spring.io/spring-framework/docs/current/reference/html/core.html#aop-proxying)

重要的是要掌握 Spring AOP 是基于代理的这一事实。请参阅 [了解 AOP 代理](https://docs.spring.io/spring-framework/docs/current/reference/html/core.html#aop-understanding-aop-proxies)，以全面了解此实现细节的实际含义。
