# 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)，以全面了解此实现细节的实际含义。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.shiker.tech/spring-he-xin-gong-neng/5.-spring-mian-xiang-qie-mian-bian-cheng/5.3.-aop-dai-li.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
