且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

好的IOC框架与asp.net mvc的使用?

更新时间:2023-12-03 14:03:28

我用 Autofac ,并已非常高兴。

配置主要是做在code等你拿编译时检查你的映射为XML格式而不是编程和***的希望。它也支持XML重写,但这样,如果你确实需要留下点什么在运行中配置/部署时间是可能的。

Configuration is mostly done in code so you get compile time checking for your mappings as opposed to programming in XML and hoping for the best. It also supports XML overrides though so if you absolutely need to leave something to be configured at run/deploy time it's possible.

借助的Contrib (不知道该怎么称呼呢?)部分提供集成了NHibernate的,起订量等对MEF团队项目的创建者在微软工作了一年,以便有一些的 MEF整合为好。

The Contrib (not sure what to call it?) portion provides integrations for NHibernate, Moq, etc. The creator of the project worked at Microsoft for a year on the MEF team so there's some MEF integration as well.

该网站的文档部分是$​​ P $ ptty的不错(不过,如果你没有找到你所需要的存在,它可能不存在......还)。在向上侧作者是SO 因此,如果您有任何疑问和适当的,你也许可以得到高质量的答案标记

The documentation section of the site is pretty good (though if you don't find what you need there, it probably doesn't exist...yet). On the up side the author is on SO so if you have questions and tag the appropriately you could probably get quality answers.

您可能也有兴趣在组织你的应用程序的配置/接线这两个博客文章是清洁的。

You might also be interested in these two blog posts on organizing the configuration/wiring of your application to be cleaner.

  1. 使用MEF和温莎城堡,提高去耦在你的架构
  2. NHibernate和WPF:该GuyWire - 虽然这是写在WPF的情况下,同样的概念也适用于web应用程序
  1. Using MEF and Castle Windsor to improve decoupling in your architecture
  2. NHibernate and WPF: The GuyWire - Although it's written in the context of WPF, the same concept would apply to a webapp.