Good IOC Frameworks to use with asp.net mvc?

I am wondering what good simple IoC frameworks are there for asp.net mvc? that have good documentation and are just easy to get up and going.

Thanks


I've used Autofac and have been very happy with it.

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.

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.

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.

  • Using MEF and Castle Windsor to improve decoupling in your architecture
  • NHibernate and WPF: The GuyWire - Although it's written in the context of WPF, the same concept would apply to a webapp.

  • 我使用温莎城堡,其他人说结构地图非常好,但基本上他们都做这项工作


    S#arp Architecture is admittedly a lot more than just IoC. It uses Castle/Windsor for IoC.

    I would recommend it as a larger set of best practices for the framework of your MVC application.

    链接地址: http://www.djcxy.com/p/82126.html

    上一篇: 在三层架构中使用BAL?如何从DAL调用方法到BAL

    下一篇: 良好的国际奥委会框架与asp.net mvc一起使用?