为什么要使用的iKernel超过IWindsorContainer? [英] Why use IKernel over IWindsorContainer?

查看:296
本文介绍了为什么要使用的iKernel超过IWindsorContainer?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看到了几个代码示例,人们已经使用的iKernel 而不是使用 IWindsorContainer 。为什么是这样?

I have seen in several code examples where people have used IKernel rather than use IWindsorContainer. Why is this?

下面是一个例子:的 http://docs.castleproject.org/(S(kwaa14uzdj55gv55dzgf0vui))/Windsor.Windsor-tutorial-part-two-plugging-Windsor-in.ashx

在上面的例子中它来到咬我,因为我加了一个subresolver

In the above example it came to bite me because I added a subresolver

Container.Kernel.Resolver.AddSubResolver(
        new CollectionResolver(Container.Kernel, true));

这将让我注入的集合......但尚未它不是工作。我想通了,因为刚刚被使用的的iKernel 它不可能使用温莎的全部功能。为什么会有人曾经想使用的内核在整个容器?我认为,如果你要实现温莎,使用完整的容器。我错了吗?为什么呢?

that will allow me to inject collections... but yet it wasnt working. I figured out that because just the IKernel was being used it couldnt use the full features of Windsor. Why would someone ever want to use the Kernel over the full container? I think if you are going to implement Windsor, use the full container. Am I wrong? Why?

推荐答案

有对于历史的原因。原来城堡项目有两个容器:微内核(的iKernel ),它提供的所有基本功能和扩展点和温莎 IWindsorContainer 这是围绕微内核的包装提供额外的功能(如XML配置,代理等),并包裹了微内核。

There are historical reasons for that. Originally Castle project had two containers: MicroKernel (IKernel) which provided all the base functionality and extension points, and Windsor IWindsorContainer which was a wrapper around MicroKernel providing additional features (like XML configuration, proxies etc) and was wrapping the MicroKernel.

这些都是更高版本(V2.5)合并成一个单个项目/组件,但要避免破坏现有用户的区别保持。

Those were later (in v2.5) merged into a single project/assembly but to avoid breaking existing users the distinction was kept.

这篇关于为什么要使用的iKernel超过IWindsorContainer?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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