Spring 学习笔记
采集日期:2008-5-4作者:vincent(注:本数据由系统自动采集,内容与BHCODE无关)
Spring 学习笔记
第一章 Spring基础概念
一.反向控制/依赖注入
IOC (Inversion of Control)
二.依赖注入的3种实现方式:
1.接口注入 (interface injection)
接口注入指的就是在接口中定义要注入的信息,并通过接口完成注入。
2.Set注入 (setter injection)
Set注入指的就是在接受注入的类中定义一个 Set 方法,并在参数中定义需要注入的元素。
<bean id="" class=""> <!--属性msg 的Set注入--> <property name="msg"> <value>propertyvalue</value> </property> </bean>
3.构造注入 (constructor injection)
构造注入指的就是