day34_Spring学习回顾_02

1、 AOP:切面编程
    切面:是 切入点 和 通知 结合。
    
2、 spring aop 编程
    <aop:config>
    方法1:
        <aop:pointcut expression="切入点表达式" id=""/>
        <aop:advisor advice-ref="通知的引用" pointcut-ref="切入点的引用"/>  特殊的切入点

    方法2:
        <aop:advisor advice-ref="通知的引用" pointcut="切入点表达式"/>  公共的切入点

3、 AspectJ xml
    <aop:config>
      <aop:aspect ref="切面类全限定名">
         <aop:pointcut>
         <aop:before>    前置通知
         <aop:afterReturning  returning="第二个参数的名称">    后置通知
         <aop:around>    环绕通知
         <aop:afterThrowing throwing="第二个参数的名称">    抛出异常通知
         <aop:after>    最终通知

4、 AspectJ annotation 
    @Aspect
    @Pointcut("表达式")  private void xxx() {...}
    @Before 
    @...

5、 切入点表达式
    <aop:pointcut expression="execution(* com.itheima.crm.*.service..*.*(..))" id=""/>
原文地址:https://www.cnblogs.com/chenmingjun/p/9415638.html