Spring By example -- core
?map wiring property
key Specifies the key of the map entry as a String
key-ref Specifies the key of the map entry as a reference to a bean in the Spring context
value Specifies the value of the map entry as a String
value-ref Specifies the value of the map entry as a reference to a bean in the Spring context
?
<bean id="auditorium"class="com.springinaction.springidol.Auditorium"init-method="turnOnLights"destroy-method="turnOffLights"/>
?第二种 ?实现InitializingBean和DisposableBean
?? ? ? ? ? ?如果用第二种方式,你的代码是和sping耦合在一起的,建议不使用
第三种?default-init-method?default-destroy-method ?
?? ? ? ? 这种情况适合于有多个bean同时定义了相同的初始化和销毁方法