主要的C#DI / IoC框架如何比较? [英] How do the major C# DI/IoC frameworks compare?

查看:118
本文介绍了主要的C#DI / IoC框架如何比较?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在进入圣战领域的风险中,这些流行的DI / IoC框架的优点和缺点是什么?可以很容易地被认为是最好的? ..:




  • Ninject

  • Unity

  • 城堡.Windsor

  • 自动填充

  • StructureMap



有没有其他DI / IoC框架,我没有在这里列出?



在我的用例的上下文中,我正在构建一个客户端WPF应用程序, WCF / SQL服务基础架构,易用性(特别是在清晰简洁的语法方面),一致的文档,良好的社区支持和性能都是我选择的重要因素。



更新:



引用的资源和重复的问题似乎已经过时了,具有所有这些框架知识的人会提出一些真正的洞察力?



我意识到,对这个问题的大多数意见可能会有偏见,但我希望有人花时间研究所有这些框架,至少有一个普遍客观的比较。



我很愿意马ke我自己的调查,如果这还没有做,但我认为这是至少有几个人已经做了。



第二次更新:



如果您有多个DI / IoC容器的经验,请对这些容器的优缺点进行排序和总结,谢谢。这不是发现人们所做的所有晦涩的小容器的练习,我正在寻找流行(和活动)框架之间的比较。

解决方案

虽然对此问题的综合回答涉及数百页我的书籍,这里是一个我仍在工作的快速比较图:




At the risk of stepping into holy war territory, What are the strengths and weaknesses of these popular DI/IoC frameworks, and could one easily be considered the best? ..:

  • Ninject
  • Unity
  • Castle.Windsor
  • Autofac
  • StructureMap

Are there any other DI/IoC Frameworks for C# that I haven't listed here?

In context of my use case, I'm building a client WPF app, and a WCF/SQL services infrastructure, ease of use (especially in terms of clear and concise syntax), consistent documentation, good community support and performance are all important factors in my choice.

Update:

The resources and duplicate questions cited appear to be out of date, can someone with knowledge of all these frameworks come forward and provide some real insight?

I realise that most opinion on this subject is likely to be biased, but I am hoping that someone has taken the time to study all these frameworks and have at least a generally objective comparison.

I am quite willing to make my own investigations if this hasn't been done before, but I assumed this was something at least a few people had done already.

Second Update:

If you do have experience with more than one DI/IoC container, please rank and summarise the pros and cons of those, thank you. This isn't an exercise in discovering all the obscure little containers that people have made, I'm looking for comparisons between the popular (and active) frameworks.

解决方案

While a comprehensive answer to this question takes up hundreds of pages of my book, here's a quick comparison chart that I'm still working on:

这篇关于主要的C#DI / IoC框架如何比较?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆