FYI, an answer I got from [EMAIL PROTECTED] 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 load-order.


> 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.


Thanks!

Geoff





Reply via email to