Dependency Inversion Principle, Dependency Injection and Inversion Of Control I’m a big fan of Dependency Injection pattern since it allows me to create more testable, maintainable and loosely coupled components. While it is easy to apply this pattern if you’ve seen some code samples you need more time to understand principles and terms around this pattern. In this article I will try to illustrate differences between those terms and explain how they come to work together. I will use well known car/engine example in this article but any example with dependency will do. All examples are written in C# language. Let’s first define few example classes: public class Engine { } public class Car { private Engine _engine ; public Car ( ) { _engine = new Engine ( ) ; } } n the example above we can see that Car (higher level component) depends on Engine (lower level component). At some point we may need to make car more reusable, for examp...