IoC 容器 - 哪个最好? (。网)
我想了解一下人们正在使用什么 IoC 容器。 我读过一些关于温莎城堡的好文章,但我知道很多人使用 StructureMap、Unity、Ninject 等。
提到的这些(以及我忽略的)之间有哪些差异。 优点? 弱点? 更适合(例如 StructureMap 对于 ABC 非常有用,但对于 XYZ 不太好)?
I'd like to get a feel for what people are using for IoC containers. I've read some good things about Castle Windsor, but I know a lot of people use StructureMap, Unity, Ninject, etc.
What are some of the differences amongst those mentioned (and any I neglected). Strengths? Weaknesses? Better fit (like StructureMap is great for ABC but not so good for XYZ)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
“最好”永远是主观的。
也就是说,我更喜欢 Castle Windsor,因为它的 XML 更简单。 顺便说一句,我只尝试过 Windsor 和 Spring.NET,所以我不能对其他的说太多。
"Best" will always be subjective.
That said, I favor Castle Windsor because its XML is simpler. I've only tried Windsor and Spring.NET, by the way, so I couldn't say much about the others.
我非常喜欢 Ninject...它简单、易于使用,它具有这种流畅的符号来声明类和接口之间的绑定,并支持上下文绑定。 惊人的。
I like much Ninject... is simple, easy to use, it has such kind of fluid notation to declare bindings between classes and interfaces and supports contextual binding. Awesome.
我喜欢结构图。 最新版本还允许您声明内联,而无需求助于 XML 配置文件。
I like StructureMap. The latest version allows you to declare inline too without having to resort to XML configuration files.