Ask Question
25 November, 22:21

Name two common methods for performing dependency injection.

+1
Answers (1)
  1. 26 November, 02:14
    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?
Get an answer to your question ✅ “Name two common methods for performing dependency injection. ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers