Home > Blockchain >  Using Microsoft Dependency Injection in net framework 4.x good practice
Using Microsoft Dependency Injection in net framework 4.x good practice

Time:12-20

Is It a good practice using Microsoft DI (Microsoft.Extensions.DependencyInjection) in a net framework 4.x console app or it is only for use in Net (core) developments?

CodePudding user response:

I think DI is good practice everywhere all the time, and here's why:

  1. It helps with testability and (somewhat) future-proofing apps for the "next big thing" - data stores, UI frameworks, etc.

  2. It may seem like overkill for a console app or something else "simple" but those are the projects that grow in importance and become mission-critical. It's very difficult to "build DI in later."

  3. It's a good habit to get in to. The more you practice it, the better you get, and the more your projects benefit.

CodePudding user response:

DI is one of the important parts of OOP. So, we can use it every development enviroment. Also you can use Ninject,AutoFac etc. It can helps you to understand what realy Dependency Injection is.

  • Related