Ask Question
16 January, 00:53

Name two common methods for performing dependency injection.

+4
Answers (1)
  1. 16 January, 02:21
    0
    Constructor Injection

    Setter Injection

    Method Injection

    Explanation:

    Dependency Injection is to inject all the dependencies required for a class to make it a loosely coupled component from it's dependencies. As the class is loosely coupled from it's dependencies, changing the logic of dependencies wont effect the class any more.

    Constructor Injection: we can inject all the dependencies of the class using constructor

    Setter Injection : we will create some properties which will set and return the dependencies of the class

    Method Injection: we will create separate method to inject dependencies into the class
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Name two common methods for performing dependency injection. ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers