When will you use dependency injection? Is there any overwhelming benefit of using dependency injection?
When will you use dependency injection? Is there any overwhelming benefit of using dependency
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Fowler has good comparision between the two in his Inversion of Control Containers and the Dependency Injection pattern Heading. In his concluding thoughts, he says
You can find more view points and comparisons in here
For DI:
constructor.
there is not a problem if the component is used with a different
framework.
mechanism will make stubbing equally feasible
Against DI: