- 主要讲Bean之间的关系:继承(),依赖(depend-on)
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<bean id="person" class="com.hgh.spring.relation.Person" p:age="12" p:city="shangsi" p:name2="hgh">
</bean>
<bean id="person2" parent="person" p:name2="dst"></bean>
<bean id="person3" abstract="true" p:age="1233" p:city="shangsi" p:name2="hgh">
</bean>
<bean id="person4" class="com.hgh.spring.relation.Person" parent="person3" p:name2="dst"></bean>
<bean id="car" class="com.hgh.spring.relation.Car" p:company="bmw" p:maxSpice="300" p:price="300000">
</bean>
<bean id="personcar" class="com.hgh.spring.relation.PersonNew" depends-on="car" p:age="14"
p:city="sss" p:name="adwa"></bean>
</beans>