你的位置: 码友网首页 / 资讯源列表 / .NET Core Opinion 9 - Embrace Dependency Injection

关于[ .NET Core Opinion 9 - Embrace Dependency Injection]的摘要:

Someone asked me why dependency injection is popular in .NET Core. They told me DI makes code harder to follow because you never know what classes and objects the app will use unless you run with a debugger. The argument that DI makes software harder to understand has been around for a long time, because there is some truth to the argument. However, if you want to build flexible, testable, decoupled classes in C#, then using a container and constructor injection is still the simplest solution.

原文地址: https://odetocode.com/blogs/scott/archive/2019/02/26/net-core-opinion-9-embrace-dependency-injection.aspx

收录时间: 2019-02-27 浏览量: 1486 分类: .NET Core

| 0 收藏 | 0