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:
It helps with testability and (somewhat) future-proofing apps for the "next big thing" - data stores, UI frameworks, etc.
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."
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.