ioc容器中bean之间的依赖和继承(Dependency and inheritance between beans in IOC container)

parent属性:只是复用依赖的bean中的属性,并不是Java中的继承。
<bean id="video" class="com.example.demo01.domain.Video" scope="singleton">    <property name="id" value="25"/>    <property name="title" value="spring 框架学习"/></bean>
<bean id="test" class="com.example.demo01.domain.Test" parent="video">    <property name="summary" value="这是summary"/>    <property name="list">        <list>            <value>spring</value>            <value>spring boot</value>            <value>spring could</value>        </list>    </property>    <property name="map">        <map>            <entry key="1" value="SpringCould 课程"></entry>            <entry key="2" value="SpringSecurity 课程"></entry>            <entry key="3" value="模拟微信支付 课程"></entry>        </map>    </property></bean>
————————
parent属性:只是复用依赖的bean中的属性,并不是Java中的继承。
<bean id="video" class="com.example.demo01.domain.Video" scope="singleton">    <property name="id" value="25"/>    <property name="title" value="spring 框架学习"/></bean>
<bean id="test" class="com.example.demo01.domain.Test" parent="video">    <property name="summary" value="这是summary"/>    <property name="list">        <list>            <value>spring</value>            <value>spring boot</value>            <value>spring could</value>        </list>    </property>    <property name="map">        <map>            <entry key="1" value="SpringCould 课程"></entry>            <entry key="2" value="SpringSecurity 课程"></entry>            <entry key="3" value="模拟微信支付 课程"></entry>        </map>    </property></bean>