[Figleaf-developer] Proxies back in and some thoughts on the Bootstrapper
Status: Alpha
Brought to you by:
steckman
|
From: <sam...@ma...> - 2004-07-04 17:42:48
|
Right, the InfromativeFactoryImpl now creates proxies as requested.
By way of a proof of concept, I've written a new ConfigurableBootstrapper based
on your original code. The only difference being that it now hands-off the
determination of which beans to use to a new ApplicationConfiguration class
(more specifically a SpringApplicationCnfiguration). The only other difference
is that rather than having the user specify which bean is runnable, I've assumed
a bean called Runnable - my aim here is for things to be simple. I also added a
TransientObjectManager which will hold objects in memory, although at present it
doesn't do anything. The SimpleApplicationContext I use looks like this:
<bean id="Introspector" class="net.sourceforge.figleaf.impl.IntrospectorImpl" />
<bean id="ObjectManager"
class="net.sourceforge.figleaf.impl.TransientObjectManager" />
<bean id="Runnable"
class="net.sourceforge.figleaf.viewer.swing.ConfigurableSwingViewer">
<constructor-arg>
<ref bean="ObjectManager"/>
</constructor-arg>
<constructor-arg>
<!-- Insert classes to register here -->
<list>
<value>net.sourceforge.figleaf.example.imageviewer.ImageAlbum</value>
</list>
</constructor-arg>
</bean>
The ConfigurableBootstrapper like this:
String springConfigFile = line.getOptionValue("config");
SpringApplicationConfiguration config = new
SpringApplicationConfiguration(springConfigFile);
getInstance().setObjectManager(config.getObjectManager());
//load the worker bean
config.getRunnable().run();
Next, I've created a slightly different SwingViewer - my version takes all
dependencies via constructors (which I think is neater than using setters to
define dependencies). I've also defined internally a default view map as I think
it's OK for us to assume default views (e.g. text entry fields) and then allow
the developer to override it. I've also changed it so the list of registered
classes to be passed in. All of this is by way of a test to see how simple we
can make application setup - I'd appreciate your comments. My
ConfigurableSwingViewer isn't as functional as yours - I originally based the
code on yours but then realised I didn't need to reinvent the wheel, just show
how it could be invoked.
Next up I want to create a bootstrapper that just uses Java code...
sam
http://www.magpiebrain.com/
|