I am studying for the Spring Core certification and I have the following doubt related to the definition of a beans collection into an XML configuration.
For example I have this XML configuration snippet:
<bean id="service" class="com.acme.service.TransferServiceImpl">
<property name="customerPolicies">
<list>
<ref bean="privateBankingCustomerPolicy"/>
<ref bean="retailBankingCustomerPolicy"/>
<bean class="com.acme.DefaultCustomerPolicy"/>
</list>
</property>
</bean>
Can you help me to understand how exactly work?
On the documentation I read that it is called the public void setCustomerPollicies(java.util.List policies)) {...} method. I think that it depend my the fact that have to be the collection initialized with the beans object into the list. Is it right?
My doubt is: why the object into the list are different type? (a ref to a privateBankingCustomerPolicy bean, a ref to a retailBankingCustomerPolicy bean and an inner bean having type as com.acme.DefaultCustomerPolicy)?
Tnx