the order of beans
Hi,
As this is my first posting here, I should begin with congratulations to Rod - a very impressive book, packed with excellent and practical advice...
We are using Rod's framework to build an app, using mySql and JBoss.
At the moment I am having a little difficulty with using the ListableBeanFactory.
One problem with creating beans from a properties file is that the beans are not kept in the order that they are listed in the file. I need to keep beans in order, and I am trying to use a properties file like this:
sun.class=com.starfriend.astro.beans.PlanetBean
sun.name=Sun
sun.symbol=Q
...
plut.class=com.starfriend.astro.beans.PlanetBean
plut.name=Pluto
plut.symbol=Z
solarSystem.class=com.starfriend.astro.beans.Solar System
solarSystem.planets=sun(ref), moon(ref), merc(ref), venu(ref), mars(ref), jupi(ref), satu(ref), uran(ref), nept(ref), plut(ref), asce(ref), midh(ref)
Rod's code creates beans that have reference to other beans, and you can create beans from a String array, so it shouldn't be too hard to make a bean with an array of references to other beans.
I'll have a go today, but I am open to suggestions!
John Pedersen
PS - I have noticed a few anomalies between the book's jar files and the source code. One class that is in the jar files but not available in the source code is com.interface21.beans.factory.support.BeanFactoryB ootstrap
There are some other classes in the jar file that are not in synch with the source files either, but I haven't kept a record of these.
|