Ask Question
2 February, 18:26

Name two common methods for performing dependency injection.

+1
Answers (1)
  1. 2 February, 18:45
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers