Dependency Injection with Method Injection

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
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.170.63