比较城堡温莎,Unity和StructureMap [英] Comparing Castle Windsor, Unity and StructureMap

查看:154
本文介绍了比较城堡温莎,Unity和StructureMap的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在后续 Krzysztof的声明中,一个href =http://www.castleproject.org/container/index.html =noreferrer> Windsor 比其他IoC还要好多了,我想了解这些IoC如何与每个其他和Windsor城堡提供的优惠/附加设施。

In a follow up to Krzysztof’s statement that Windsor does a lot more than other IoC’s, I wanted to understand how these IoC’s stack up against each other and the benefits/additional facilities that castle Windsor provides.

有没有比较?有人可以帮助我了解Castle Windsor提供的其他功能,其他IoC的

Are there any comparisons? Can someone help me understand the additional features that Castle Windsor provides over other IoC’s

推荐答案

请参阅这里这里对几个IoC容器进行了彻底的技术比较,尽管现在有些过时了(他们来自Windsor 2.0之前)

See here and here for a pretty thorough technical comparison of several IoC containers, although somewhat outdated by now (they're from before Windsor 2.0)

然而,我认为Windsor提供的其他容器并不具有任何真正的功能。 Windsor StructureMap Spring.NET 已经存在了好几年了,并已被大量使用这些年来的项目已经非常成熟了。较新的容器,例如 Autofac Unity Ninject SimpleInjector 基于以前的经验,所以他们也不会缺乏这些重要的功能。

However, I don't think there are really any vital features that Windsor offers and other containers don't. Windsor, StructureMap, Spring.NET have all been around for several years and have been used in lots of projects over these years so they're very mature now. Newer containers, like Autofac, Unity, Ninject and SimpleInjector build on that previous experience so they won't lack those vital features either.

现在答案的主观部分更为主观:我喜欢认为Windsor具有可用性,可扩展性和集成模块的完美结合。

Now the more subjective part of the answer: I like to think that Windsor has a nice mix of usability, extensibility and integration modules.

可用性:例如,您可以使用XML和/或代码注册(它也有一个流畅的API ,像现在的大多数容器一样)。

Usability: for example, you can use XML and/or code registration (it also has a fluent API like most containers nowadays).

可扩展性许多扩展点,您可以使用定制或覆盖任何默认行为。

Extensibility: Lots of extension points that you can use to customize or override pretty much any default behavior.

集成:Windsor拥有许多设施(模块),允许轻松与其他框架/库集成。其他集成包括 ASP.NET MVC MonoRail Workflow Foundation NServiceBus MassTransit 犀牛服务总线 Quartz.Net Solr Net SolrSharp Windows传真服务

Integration: Windsor has lots of facilities (modules) that allow for easy integration with other frameworks/libraries. Other integrations include ASP.NET MVC, MonoRail, Workflow Foundation, NServiceBus, MassTransit, Rhino Service Bus, Quartz.Net, SolrNet, SolrSharp, Windows Fax Services.

这一系列文章涵盖了Windsor的许多优点和扩展点。

This series of articles covers many niceties and extension points of Windsor.

请注意,我不是说其他容器不提供类似的东西!即使你选择了其中一个,后来发现它缺乏一些集成,通常不难自己编码。

Note that I'm not saying that other containers don't offer similar things! Even if you picked one of them and later you found out it's lacking some integration, it's usually not hard to code it yourself.

底线 :只要您正确地构建代码(例如避免服务定位器反模式),我不认为任何主要的IoC容器可能会出错。

Bottom line: I don't think you can go wrong with any of the main IoC containers, as long as you structure your code properly (e.g. avoid the service locator anti-pattern).

这篇关于比较城堡温莎,Unity和StructureMap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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