一、AOP 概念 \c&%F=1+*
Joinpoint:它定义在哪里加入你的逻辑功能,对于Spring AOP,Jointpoint指的就是Method。 lPh>8:qFM
qV$\.T>x
Advice:特定的Jointpoint处运行的代码,对于Spring AOP 来讲,有Before advice、AfterreturningAdvice、ThrowAdvice、AroundAdvice(MethodInteceptor)等。 fA
u^%jiU
-.|V S|y
Pointcut:一组Joinpoint,就是说一个Advice可能在多个地方织入, C?e1 a9r
:XK.A
Aspect:这个我一直迷惑,它实际是Advice和Pointcut的组合,但是Spring AOP 中的Advisor也是这样一个东西,但是Spring中为什么叫Advisor而不叫做Aspect。 nf5Ld"|%9
V`V
Z[
Weaving:将Aspect加入到程序代码的过程,对于Spring AOP,由ProxyFactory或者ProxyFactoryBean负责织入动作。 k0{5)Su"xr
"-Lbz)k
Target:这个很容易理解,就是需要Aspect功能的对象。 W9~vBU
Y" &