In this chapter, I describe dependency injection (DI), a technique that helps create flexible applications and simplifies unit testing. Dependency injection can be a difficult topic to understand, both in terms of why it can be useful and how it is performed. To that end, I build up slowly, starting with the conventional way of building application components and gradually explaining how dependency injection works and why it matters. Table 18-1 puts dependency injection into context.
Table 18-1. Putting Dependency Injection in Context
What is it?
Dependency Injection makes it easy to ...