April 05
Prof. Ismael H. F. Santos -
ismael@tecgraf.puc-rio.br
2
Property Values for BeanFactories
(continued)
n
The real magic comes in when you can set a property on
a bean that refers to another bean in the configuration:
n
n
n
n
n
n
n
n
This is the basic concept of
Inversion of Control
<bean name=“widgetService”
class=“com.zabada.base.WidgetServiceImpl”>
<property name=“widgetDAO”>
<ref bean=“myWidgetDAO”/>
</property>
</bean>
calls
setWidgetDAO( myWidgetDAO )
where
myWidgetDAO
is another bean
defined in the configuration