In this chapter, we will examine some of the ways dependency injection (DI) can go wrong.
As programmers, our enthusiasm towards a new tool or technique can sometimes get the better of us. Hopefully, this chapter will help to ground us and keep us out of trouble.
It's important to remember that DI is a tool and, as such, it should be applied selectively, when it's convenient, and when it's the right tool for the job.
The following topics will be covered in this chapter:
- DI induced damage
- Premature future-proofing
- Mocking HTTP requests
- Unnecessary injection?