On Sat, 2003-07-12 at 22:03, Geoff Howard wrote:Actually, I asked both questions!
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.
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 isAnd that's the good news I was hoping for - better than relying on load-order.
returned. In this case you don't need to worry about component
initialization order. You only need to worry about cyclic dependency
loops.
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.I'm not sure how well ECM handled all of this, but all the newer containers should handle this without any trouble.
Thanks!
Geoff
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
