Todor Boev
2008-08-19 07:38:33 UTC
Hello,
I am a long time observer of IoC/DI containers but sadly have not had a
chance to use them for a real project yet :( Therefore my views on the
matter are probably immature. I believe DI should permeate the program
in depth rather than be used only for the first few long-lived
components. I would like to use the DI container as a replacement of
good'ol new. So DI should be about scope management. Like in the
classical http example where components live in
"server"->"connection"->"request" scope and each scope creates and
destroys multiple instance of the next scope. However this means that at
least one object in the older scope must use the container API to
create->populate->start->stop->destroy the next scope. Isn't this at
odds with the number one DI principle of keeping components independent?
Is there some popular practice to deal with this or I should just accept
that the coast of DI everywhere is some dependence on the container API?
Cheers,
Todor
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
I am a long time observer of IoC/DI containers but sadly have not had a
chance to use them for a real project yet :( Therefore my views on the
matter are probably immature. I believe DI should permeate the program
in depth rather than be used only for the first few long-lived
components. I would like to use the DI container as a replacement of
good'ol new. So DI should be about scope management. Like in the
classical http example where components live in
"server"->"connection"->"request" scope and each scope creates and
destroys multiple instance of the next scope. However this means that at
least one object in the older scope must use the container API to
create->populate->start->stop->destroy the next scope. Isn't this at
odds with the number one DI principle of keeping components independent?
Is there some popular practice to deal with this or I should just accept
that the coast of DI everywhere is some dependence on the container API?
Cheers,
Todor
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email