What is dependency injection

0 votes
My question is what is dependency injection? Also when and why should it or should not be used? Any leads would be beneficial for me.
Feb 8, 2022 in Others by Rahul
• 9,670 points
109 views

1 answer to this question.

0 votes

According to James Shore, the term “Dependency Injection” is nothing but a 25 dollar term in exchange for a 5% concept. In other words, when the instance variables are given to an object. It basically, provides the required objects that an object needs which are its dependencies instead of constructing themselves. This allows dependencies to be stubbed out and is hence, a very useful technique for testing. Constructor and Setter injection are one of the many ways in which dependencies can be injected into objects.The use of specialized dependency injection framework also works but might not be required in order to have a dependency injection. Detecting and passing dependencies explicitly is equally good as an injection as an injection by the framework. 
 

answered Feb 8, 2022 by Soham
• 9,700 points

Related Questions In Others

0 votes
1 answer

What is the difference between hadoop and google analytics ?

I will try and answer this as ...READ MORE

answered Aug 22, 2018 in Others by Frankie
• 9,830 points
925 views
+5 votes
6 answers

what is artificial neural network?

Machine Learning is a field of computer ...READ MORE

answered Dec 17, 2018 in Others by Raghumishra
• 240 points
1,190 views
+1 vote
1 answer

What is the difference between Dark Web and Deep Web?

The content that which you cannot find ...READ MORE

answered Feb 6, 2019 in Others by Priyaj
• 58,100 points
474 views
+1 vote
2 answers

What is the different between xml and json?

These are the differences:   It is JavaScript Object ...READ MORE

answered Feb 7, 2019 in Others by Junaid
520 views
0 votes
0 answers

What is ADT? (Abstract Data Type)

Can someone explain to me what ADT ...READ MORE

May 19, 2022 in Others by Kichu
• 19,050 points
109 views
0 votes
1 answer

what is cloud computing with example

In simple terms, cloud computing is storing ...READ MORE

answered Feb 2, 2022 in Cloud Computing by Edureka
• 12,880 points
1,116 views
0 votes
1 answer

What is the difference between tree depth and height?

To answer your question, you will have ...READ MORE

answered Feb 9, 2022 in Python by Rahul
• 9,670 points
319 views
0 votes
1 answer
0 votes
1 answer

What is Mocking?

The meaning of the word refers to ...READ MORE

answered Feb 8, 2022 in Others by Soham
• 9,700 points
129 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP