Why does one use dependency injection

0 votes
I'm making an effort to comprehend dependency injections (DI), but I keep failing. It simply looks absurd. My code is never a mess, and all of my configuration is magically serialised into a class using json.net. I am also having troubles understanding what problems does it solves.

What are some actual circumstances when using DI would be appropriate when developing a website or desktop application? I can easily think of reasons why someone might wish to utilise interfaces or virtual functions in a game, but I can't think of even one time when it was used in non-game code.
Sep 26, 2022 in C# by krishna
• 2,820 points
541 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In C#

0 votes
1 answer

Switch case: can I use a range instead of a one number

To categorise your switch circumstances, I would ...READ MORE

answered Jun 13, 2022 in C# by krishna
• 2,820 points
426 views
0 votes
1 answer

What does the extension method do in c# and why do you need it

Extension Methods allow you to add additional ...READ MORE

answered Jun 21, 2022 in C# by krishna
• 2,820 points
649 views
0 votes
1 answer

What is cool about generics, why use them

Okay. For simplification, I am listing it ...READ MORE

answered Jun 23, 2022 in C# by krishna
• 2,820 points
494 views
0 votes
0 answers

How to create dependency injection for ASP.NET MVC 5

It's simple to create Dependency Injection using ...READ MORE

Jun 11, 2022 in C# by pranav
• 2,590 points
515 views
0 votes
1 answer

Why program working differently on every run when using async?

You can use the async Main method ...READ MORE

answered May 30, 2022 in C# by rajiv
• 1,620 points
560 views
0 votes
1 answer

Why should I avoid using Properties in C#?

Jeff dislikes properties because they resemble fields, ...READ MORE

answered Jun 7, 2022 in C# by rajiv
• 1,620 points
651 views
0 votes
1 answer

What is dependency injection?

According to James Shore, the term “Dependency ...READ MORE

answered Feb 8, 2022 in Others by Soham
• 9,710 points
709 views
0 votes
1 answer
0 votes
1 answer

Why does one use dependency injection?

I believe that many people are perplexed ...READ MORE

answered Jun 6, 2022 in C# by pranav
• 2,590 points
444 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