In the previous chapter, we used a constructor to inject our dependencies. Doing so simplified our object and the life cycle of its dependencies. But what happens when our dependency is different for every request? This is where method injection comes in.
The following topics will be covered in this chapter:
- Method injection
- Advantages of method injection
- Applying method injection
- Disadvantages of method injection