Jim Weirich has dared people to define Dependency Injection in One Sentence. Here goes:
Dependency injection is a palliative for environments that unnecessarily couple creation, lookup, and interaction between collaborators.
Jim Weirich has dared people to define Dependency Injection in One Sentence. Here goes:
Dependency injection is a palliative for environments that unnecessarily couple creation, lookup, and interaction between collaborators.
Comments
Wow, fascinating use of the word palliative. So what might you suggest would be the real cure to the problem of unnecessary coupling? Personally I hope to never work in a tightly coupled environment again, but should that happen I would think that DI would be a good thing so there is a common framework for alleviating said coupling.
I think that unnecessary coupling often comes at the platform level, so the cure is to fix the platform. DI is a good thing, but it is a palliative: Using DI on a project doesn’t cure my platform—I have to use DI again on the next project.
Well said. Love the quote, by the way.