Danny Angus wrote:
On 11/11/06, Serge Knystautas <[EMAIL PROTECTED]> wrote:

Yeah, I'm biased, but I like think this is part of the advantages of
just dependency injection.

I'm still waiting for someone to give a sensible DI example that would
show how we deal with the fact that there can be an unlimited number
of unknown dependancies.

I posted one but for some reason it didn't make it to the list. I will post it again
when I get motivation on Monday.

Service location allows the consumer of the services to look them up
as needed, DI requires that the container be made aware of the
dependance and invoke some mechanism to inject an instance which
satisfies it.

In what way is injection preferable to lookup?
Lookup doesn't necessarily help with dependence at all. Meaning you just get NPEs all over the place because the other service isnt' start. Dependence, injection and lookup are all orthogonal.

d.


Reply via email to