- Dependency injection can make tests easier
- Helps create more loosely coupled code
Dependency Inversion
Get your program to rely on a behaviour, rather than an implementation - Can be done by making it depend on an interface instead!
- Instead of initialising an object in a method, we pass it as an argument.
- Useful for situations where each implementation of an object has different constructor signatures