Berin Loritsch wrote:

The choice of how to apply IoC is a matter of taste in many cases. If
everything is passed in the constructor, then we have a more atomic construction
phase. But in reality no component is used until after the construction phase.

Yep, but you have no control over the order in which the lifecycles Compose, Configure, Initialize, Contextualize etc. are called. Everything is collapsed within the constructor and it is assumed that the order of construction is irrelevant.


However, it does make a difference whether you initialize an unconfigured component or configure an uninitialized component. For example, a component that accesses an external resource might need a username/password before it can do that. So it is vital that this component passes through configuration before initialisation.

Of course it is possible to maintain the correct order in a constructor, but it cannot be guaranteed anymore. The component itself decides.

Ulrich



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to