Spring (二)

一、使用注解配置spring

  1. 步骤:

      

  2. 将对象注册到容器

      

  3. 修改对象的作用范围    

      //指定对象的作用范围
      @Scope(scopeName="singleton")

  4. 值类型注入(两种方式)

       

  5. 引用型类型注入

       

  6. 初始化  |  销毁的方法

        

 二、spring与junit整合测试

、      

三、spring中的aop 

  1. aop思想介绍

  2. spring中aop的概念

        

  

   3. spring实现aop的原理

      

  4.aop 名词

      

 四、spring中的aop演示

   步骤(xml配置)

      

  2. 准备目标对象

      

    3.准备通知

      

      

  4.配置进行织入,将通知织入目标对象中

    

    

   步骤(注解配置)

    前三步与xml配置相同

    第四步:

        

        

        

       

      

原文地址:https://www.cnblogs.com/zhou-pan/p/8376705.html