简体   繁体   English

支持 MVVM 框架的 IoC 或依赖注入框架

[英]IoC or Dependency Injection frameworks to support for an MVVM framework

I have been developing a new MVVM framework here .我一直在这里开发一个新的 MVVM 框架。

It has some interesting concepts, but I'd like to support multiple IoC containers.它有一些有趣的概念,但我想支持多个 IoC 容器。 Right now I'm supporting just MEF, because it comes with.Net 4.0.现在我只支持 MEF,因为它带有.Net 4.0。

What are some of the more common IoC/DI frameworks I should look into supporting from the start?我应该从一开始就支持哪些更常见的 IoC/DI 框架? I'm thinking maybe 3 or so.我想大概3个左右。

Castle Windsor?温莎城堡? Ninject?忍者?

EDIT:编辑:

Just to clarify, I'm asking which IoC/DI frameworks are commonly used today.澄清一下,我问的是当今常用的 IoC/DI 框架。 I was hoping to also learn of some of the new hotness that's out there and I've not heard of yet.我希望也能了解一些我还没有听说过的新热点。

A library or framework should not use a DI Container - only applications should use containers .框架不应该使用 DI 容器——只有应用程序应该使用容器

Libraries and frameworks should be designed so that they are friendly to any sort of DI , whether or not the user wants to use a container or Poor Man's DI .库和框架的设计应使它们对任何类型的 DI 都友好,无论用户是否想使用容器或Poor Man's DI

Assume that the user will be using Poor Man's DI and you will automatically be container agnostic .假设用户将使用Poor Man's DI,而您将自动成为容器不可知论者

Unity and Castle Windsor should be a must in my opinion, especially Unity since it's used in Prism and it is part of the Enterprise Library (for portability).在我看来, UnityCastle Windsor应该是必须的,尤其是 Unity,因为它用于 Prism 并且它是 Enterprise Library 的一部分(用于便携性)。 And Castle windsor for its easy of use (for a broader community)温莎城堡易于使用(适用于更广泛的社区)

An alternative would be to provide a simple IoC Container just like Mvvm Light does.另一种方法是提供一个简单的 IoC 容器,就像Mvvm Light一样。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM