.NET 中 IoC 容器的当前状态如何?
我知道以前也有人问过类似的问题
我希望了解 .NET 领域中 IoC 容器框架的当前状态。
关于这个主题的其他问题已经很过时了。我正在准备有关该主题的课程,因此我想提供最相关的信息。
目前 .NET 中 IoC 容器中最好的是什么?为什么?
什么是最受欢迎的?
I know similar questions have been asked before
I'm looking to get the current state of IoC container framework in the .NET sphere.
Other questions on this topic are pretty dated. I'm prepping for a course on the subject, so I would like to present the most relevant information.
What currently is the best in IoC containers in .NET and why?
What is the most popular?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
没有人知道哪个 DI 容器是最受欢迎的,但这里有一个提示:
比较 NuGet 上的下载统计信息。所有主要的 .NET 容器都可以通过 NuGet 获得,因此这样做可以让您了解容器之间的相对流行度排名。
请注意,从统计角度来看,此方法存在问题,原因有很多:
尽管建议的比较方法不准确,但它仍然是我所知道的最好的方法。接受它本来的样子。
No-one knows which DI Container is the most popular one, but here's a tip:
Compare download statistics on NuGet. All the major .NET containers are available through NuGet, so doing that will give you an idea about the relative popularity ranking between the containers.
Be aware that this method is problematic from a statistical viewpoint for a number of reasons:
Despite the inaccuracy of the suggested comparison method, it's still the best that I'm aware of. Take it for what it is.
我认为 Scott Hanselman 几年前的帖子仍然相关 .NET 依赖注入容器 (IOC) 列表)
每个容器框架都增加了功能并进行了改进,现在似乎都支持流畅的接口。
我个人使用 Autofac
Nicholas Blumhardt 编写了 很棒的文章“关系动物园”,它详细描述了这些天您可以使用依赖注入做什么 - 非常值得所读的。
I think Scott Hanselman's post from a couple of years ago is still relevant List of .NET Dependency Injection Containers (IOC)
Each of the container frameworks has added functionality and refined, all seem to support fluent interfaces now.
Personally I use Autofac
Nicholas Blumhardt has written a great article 'The Relationship Zoo' which describes in detail what you can do with Dependency Injection these days - well worth the read.