I guess I can explain my problem best by a small code-exmaple:
<bean id="DeviceManager" class="...">
<ref id="device_1" />
<ref id="device_2" />
<ref id="device_n" />
<bean id="device_1" class="MyDevice">
<bean id="device_n" class="MyDevice">
My problem: My devicemanager has a list of devices. The DeviceManager receives some information, passes this on to the devices and waits for result (callback)
Now, the example above probably works, but the device definitions are pretty dynamic. Each installation of the application has a different device list.
I could each time modify the beans.xml file (which will become pretty big) or look for another solution.
In the avalon framework, you could instantiate a device (from within the devicemanager) and pass on a configuration using the ConfigurationUtils.
What is the best way in Spring?
A database might be an option, but we are working with existing code (port from avalon to Spring) and using a database requires a rewrite. Besides this, there is also a lifecycle issue .
Another solution is to give a configuration file to the devicemanager which uses a factory (in combination with the config file) to instantiate a list of devices, but this seems odd.....
Any suggestions welcome