Dependency Injection

@ircmaxell has a great explanation of the concept of dependency injection (DI). I won’t even link to anything else about the concept because any Wikipedia entry would just confuse the issue. Watch this video first, then go Googling.

It took me at least a couple of years to get to the level of understanding @ircmaxell describes here because I read too much complicated material about it. He is right to highlight that you don't need a Dependency Injection Container (DIC) to be doing DI.

His description of the meaning of the “Dependency Inversion Principle” is great: it is “the principle that code should depend upon abstractions.” I feel like it taught me a thing or two even though I’ve been steeped in these concepts and read tons of articles about them.

(Via this.)

@ircmaxell is a great teacher and blogger. You should follow him.

If you would like to comment on this article, please send me an email at pennedav@gmail.com.
Feedback from comments may be incorporated in the form of updates to the article text.