ssh框架问题

来源:百度知道 编辑:UC知道 时间:2024/06/21 09:14:19
<beans>

<bean id="intoWService_"
class="com.sailing.app.test.instoreroom.IntoWServiceImpl">
<property name="intoWDAO" ref="intoWDAO_"/>
</bean>

<bean id="intoWDAO_"
class="com.sailing.app.test.instoreroom.IntoWDAO"
autowire="byName"/>
</beans>

这个在一个文件中应该怎么解释啊!

首先说dao层,先声明了一个intoWDAO实例,在一个web项目中只有这一个实例,class则是对应的这个类,在service这里,同样也是声明了一个实例,和一个对应的实现类,property则是引用dao层,通过依赖注入在service中获得dao这个实例,这样就分类了层与层之间的联系,降低了耦合性,具体的propety中的ref对应的是spring配置文件中的dao配置id,name则是在service中声明的一个实例,通过set方法得到的! 说的不好,

这不是spring的属性注入么。。