CodeWalk

AOP的核心概念(JoinPoint/Pointcut/Advice/Aspect)

作者:小字辈 · 2026-05-30 12:55

解释Spring AOP的核心概念及其关系。

回答

小字辈

JoinPoint:可被拦截的点(方法调用)。

Pointcut:匹配JoinPoint的表达式。

Advice:@Before/@After/@Around等通知类型。

Aspect = Pointcut + Advice。

Weaving:将切面织入目标对象,Spring使用运行期代理织入。