@@ di13.xml(컨테이너)
# 포함될 객체 선언 (생성자를 이용해 객체 생성)
<bean id="prod01" class="a01_diexp.z01_vo.Product">
<constructor-arg value="사과"/>
<constructor-arg value="3000"/>
<constructor-arg value="2"/>
</bean>
<bean id="prod02" class="a01_diexp.z01_vo.Product">
<constructor-arg value="복숭아"/>
<constructor-arg value="3500"/>
<constructor-arg value="7"/>
</bean>
<bean id="prod03" class="a01_diexp.z01_vo.Product">
<constructor-arg value="딸기"/>
<constructor-arg value="5000"/>
<constructor-arg value="13"/>
</bean>
# 포함할 객체 선언
<bean id="mt01" class="a01_diexp.z01_vo.Mart">
<constructor-arg value="하나로마트"/>
<property name="plist">
<list>
<ref bean="prod01"/> // 포함될 객체 ref로 선언
<ref bean="prod02"/>
<ref bean="prod03"/>
</list>
</property>
</bean>
@@ DIExp13.java
String path="a01_diexp\\di13.xml";
GenericXmlApplicationContext ctx = new GenericXmlApplicationContext(path);
Mart mt01 = ctx.getBean("mt01",Mart.class); // 자동으로 Mart 객체 생성
mt01.buyList();
@@ di14.xml(컨테이너)
# Set
<bean id="sensor01" class="a01_diexp.z01_vo.Sensor">
<property name="agent">
<set>
<value>주식매매</value>
<value>자산관리</value>
<value>자산관리</value>
<value>주식매매</value>
<value>보험관리</value>
<value>연금투자</value>
<value>연금투자</value>
<value>주식매매</value>
</set>
</property>
# Properties
<property name="addInfo">
<props>
<prop key="사과">3000</prop>
<prop key="바나나">4000</prop>
<prop key="바나나">4500</prop>
<prop key="구매자">홍길동</prop>
</props>
</property>
</bean>
# Map
<bean id="student01" class="a01_diexp.z01_vo.Student">
<property name="point">
<map>
<entry key="국어" value="90"/>
<entry key="영어" value="87"/>
<entry key="수학" value="77"/>
</map>
</property>
</bean>