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
1,143 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
769 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
1,085 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
884 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
763 views