zoukankan      html  css  js  c++  java
  • Spring in Action 学习笔记二-DI

    装配bean

    2015109

    9:49

         

         

    Sprng中,对象无需自己负责查找或创建其关联的其他对象。相关,容器负责吧需要相互协作的对象引用赋予各个对象。

    创建应用对象之间协作关系的行为通常被称为装配(wiring)。这是依赖注入的本质。

         

         

    声明bean

         

    典型的xml配置文件

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:17

         

    spring核心自带了10个命令空间

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:18

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:19

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:20

         

    构造器注入:

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:20

         

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:21

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:22

         

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:22

         

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:22

         

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:23

         

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:23

         

    初始化和销毁

         

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:24

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:25

         

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:26

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:26

         

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:26

         

         

    注入属性

    1、注入简单值:

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:49

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:49

         

         

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:49

         

    2 引入其他bean

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:50

         

         

    引入内部bean

         

    屏幕剪辑的捕获时间: 2015-10-9 10:51

         

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:52

         

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:52

         

    命令空间p装配属性

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:52

         

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:53

         

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:53

         

    3、装配集合

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:54

         

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:55

         

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:55

         

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:55

         

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:56

         

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:56

         

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:56

         

         

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:56

         

         

    Maap

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:57

         

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:57

         

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:57

         

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:57

         

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:58

         

         

    空值:

         

         

         

    屏幕剪辑的捕获时间: 2015-10-9 10:58

         

         

    使用表达式装配(略)。

         

         

         

         

    最小化xml配置

    2015109

    11:10

         

    4中类型的自动装配(略)

         

         

    屏幕剪辑的捕获时间: 2015-10-9 11:11

         

         

         

    3.2 注解装配:

         

    屏幕剪辑的捕获时间: 2015-10-9 11:14

         

         

         

    屏幕剪辑的捕获时间: 2015-10-9 11:15

         

         

         

    屏幕剪辑的捕获时间: 2015-10-9 11:19

         

         

         

    屏幕剪辑的捕获时间: 2015-10-9 11:19

         

         

         

    屏幕剪辑的捕获时间: 2015-10-9 11:19

         

         

         

    屏幕剪辑的捕获时间: 2015-10-9 11:19

         

         

         

         

         

         

        

  • 相关阅读:
    如何让你的Sublime和Codeblocks支持C++11
    Python print不换行输出的替代方法
    阶梯博弈
    hdu4633_Polya定理
    Ural_1169_Pairs
    ACM竞赛中的魔方问题专题(不定时更新)
    LintCode 35. 翻转链表
    windows中mysql5.7中配置中文字符集和默认datadir
    CentOS7使用打开关闭防火墙与端口
    关于阿里巴巴开发手册"不得使用外键与级联,一切外键概念必须在应用层解决"的疑惑
  • 原文地址:https://www.cnblogs.com/xuddong/p/4870129.html
Copyright © 2011-2022 走看看