Dependency injection and IOC containers in a closed project

Posted by Puckl on Programmers See other posts from Programmers or by Puckl
Published on 2012-10-01T17:50:40Z Indexed on 2012/10/01 21:50 UTC
Read the original article Hit count: 264

Does it make sense to assemble my project with dependency injection containers if I am the only one who will use the code of that project?

The question came up when I read this IOC Article http://martinfowler.com/articles/injection.html

The justification for using dependency injection in this article is that friends can reuse a class, and replace depending classes with their own classes because they get injected and not instantiated in the class.

I would only use it to inject objects where they are needed instead of passing them through layers to their target. (Which is not so bad I learned here: Is it bad practice to pass instances through several layers?)

(Maybe I will reuse parts of the project, who knows, but I don´t know if that is a good justification)

© Programmers or respective owner

Related posts about design-patterns

Related posts about dependency-injection