Implementing Dependency Injection

In software development, it's always recommended to split the system into loosely coupled modules that can work independently as much as they can. Dependency Injection is a pattern that helps to reach this goal, creating a maintainable and testable system.
Dependency Injection is often confused with complex and over-configurable frameworks that permit us to add DI to our code; in reality, it is a simple pattern that can be added without too much effort.
We'll look at different examples of Dependency Injection and the benefits it gives to the code.

In this chapter we will: