On Tue 11 Aug 2009 22:36, Leo Simons <[email protected]> wrote:

> On Tue, Aug 11, 2009 at 10:44 AM, Robert Burrell
> Donkin<[email protected]> wrote:
>> avalon is an IoC container but is mainly tooled for composition using
>> the Service Locator pattern (Servicable, ServiceManager). these days,
>> dependency injection (whether through setters or constructors) is much
>> more popular. so, i think we should add setters, getters and
>> constructors so that Servicable components can also play well in DI
>> containers.
>>
>> opinions?
>> objections?
>
> The avalon lifecycle interfaces have this nice container-provided
> guarantee that after the last few of them have been called, you know
> your component is in a fully initialized state, fully aware of its
> surroundings, and that those surroundings won't change after that
> (unless you implement Re* which is again a set of specific contracts).
>
> While I think its quite alright to add support for dependency
> injection, I think it is important to keep this
> guaranteed-to-be-initialized-at-an-obvious-point-in-time contract
> intact. That's trivially true if you use constructor DI, but not so
> much so if you add setters, so I'd rather not see any setter
> injection.

I agree with Leo on this one.  If there's a way we can support running
Avalon services in setter-style DI containers, then that's great.  But
I'd also want to make sure that all the promises we've made about
lifecycle support are maintained.

-- 
   J. Aaron Farr
   馮傑仁
   www.cubiclemuses.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to