Dependency Injection (DI) is a design pattern that demonstrates how to create loosely coupled classes. The term “loosely coupled” deserves clarification and sometimes the best way to explain something is by first describing its opposite, which in this case is “tight coupling.” When two classes are tightly coupled, they are linked with a binary association. For example, you might have two classes, Class1 and Class2, that are joined together as an aggregation.