cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoff Howard <>
Subject Re: Lifecycle Help
Date Sun, 13 Jul 2003 03:29:46 GMT
FYI, an answer I got from dev@avalon.  Should have asked there first. 
I'm sure I read this before but just wasn't positive.

J Aaron Farr wrote:

 > On Sat, 2003-07-12 at 22:03, Geoff Howard wrote:
 >> Follow up:
 >> Is the order of component initialization a reliable contract with the
 >> Container?  If component A is defined before component B, can it be
 >> relied on that they are initialize()-ed first A then B?
 >> Geoff
 > Are you asking how to know what order components are initialized by the
 > container?  This depends on the lifestyle of the component and on the
 > container itself.
Actually, I asked both questions!

 > However in terms of component assembly (which is what I think you're
 > asking about), if you access _any_ component via the ServiceManager, it
 > goes through the proper lifecycle methods before it is returned.  In
 > other words:

 > The 'b' instance of ComponentB will be properly initialized before it is
 > returned.  In this case you don't need to worry about component
 > initialization order.  You only need to worry about cyclic dependency
 > loops.
And that's the good news I was hoping for - better than relying on 

 > I'm not sure how well ECM handled all of this, but all the newer
 > containers should handle this without any trouble.
It seems to be working that way under ECM, but I just hadn't seen it 
documented, and I tracing the lifecycle stuff through the code was too 
hard to follow with any confidence.



View raw message