SPRING中注入问题

来源:百度知道 编辑:UC知道 时间:2024/06/07 06:56:13
<bean id="userManagerService" parent="baseTransactionProxy">
<property name="proxyInterfaces">
这段中 PARENT是不是等同于REF啊,下面<property name="proxyInterfaces">
中的属性代表的是什么意思啊?
汗 1楼的概念我也知道的 问题是PROPERTY代表什么呢?PARENT是不是等同于REF啊?

parent不等同于ref

parent表示继承的父类的Bean

如果有很多继承同一个父类的Bean

那么在配置文件中实例那些Bean时候可以省略掉父类已经注入的属性

<property name="proxyInterfaces">中的属性代表的是对接口的代理

<bean id="userManagerService" class="com.gameplus.sinogame.service.systemManage.impl.UserManagerService">
<property name="proxyInterfaces">
<ref bean="proxyInterfaces"/>
</property>
</bean>

<property name="proxyInterfaces">代表你向userManagerService注入的元素的引用,<ref bean="proxyInterfaces"/>代表你向userManagerService注入的元素