As far as the order that objects are created, ColdSpring will pretty much create object in the reverse of the order in which they are discovered, via an objects dependencies. This is as close as possible to the way that a recursive tree would work, except for the fact that ColdSpring will not go out to the top of a loop again if an object is found for a second time, which could cause a recursive loop, to be known from now on as 'Circular Dependency Hell'! Sorry, I spend a long time in there...

Anyway, I will try to maybe diagram out what it looks like, I did draw it on the white board at work. The thing is though, it's hard to depend on the order of an objects creation, and generally not that good of an idea, which is why the bean attribute 'init-method' exists. You know that all object have been created and all dependencies resolved before any 'init-methods' are called. And if there are factory beans involved, the factories have been set up, the beans have been created as well.

Of course, just to point out so I'm not too confusing, we are talking about all objects necessary to fully set up the bean being asked for with getBean(), and any objects those need, and so forth...



On May 25, 2006, at 2:18 PM, Peter J. Farrell wrote:

Peter J. Farrell said the following on 5/25/2006 1:07 PM:
Dave Ross said the following on 5/25/2006 12:58 PM:
  
Brian is correct - init() is called right after the component is
created and setter methods are called after that (in no particular
order). Sounds like you are looking for "init-method" which allows you
to specify a method that coldspring will call on your component after
all the dependencies have been set.
    
For the sake of consistency, I typically call my init-method "setup"
which is called after the entire CS bean factory as been init'ed (I
think this is correct).  Just throwing that out...
  
Dave, if you or Chris can write something out - I'll be more than willing to create flow chart that shows the creation process that ColdSpring uses.  It perplexed me for a while when I first started.  Just an idea.

.Peter
-- 
Peter J. Farrell - Maestro Publishing
Certified Adobe ColdFusion MX7 Developer
Member Team Mach-II and Team Fusion
--
Co-Host of the ColdFusion Weekly Podcast
The "Virtually Live" Call-In Show
http://www.coldfusionweekly.com




Reply via email to