Using MEF with NHibernate and Castle Windsor


Using MEF with NHibernate and Castle Windsor



I have an ASP.Net MVC application that is using NHibernate under the covers for data access. I'm using the Windsor container to handle injecting ISession references into each controller.

This works great, but now I'm looking to expand my application with a pluggable architecture so that I can have a core product and specific add-ons. I found a great article on doing this with MEF.

My question is how to make the Windsor container and MEF container, life/work together so that I can achieve this. There was an article by Glenn Block that talked about this exact issue. Then end then said that the next article would show you how to do this, but there's no part 2.

Has anyone created an application like this using ASP.Net MVC, MEF, NHibernate and Castle Windsor?


E-commerce site: ASP.NET or ASP.NET MVC?

1:

Is this a valid jquery callback function call?
I have spiked small prototype of Windsor->Mef integration 6 months ago here. Having POCOs, Entities and ViewModels in a solution feels like overkillIt is tarreceive ting the scenario you seem to be implementing, where you bootstrap your application with Windsor, and want to use MEF for extensibility. asp.net mvc html Drop down list helper isn't selecting optionYou must check it out, perhaps it'll commit you any ideas. Asp.net MasterPage equivalent in Ruby on Rails, Trying to define a site wide layout
ASP.NET MVC 2 and ComponentModel.DataAnnotations Validation: minimum value attributeBest custom dynamic grid for MVC [closed]

2:

asp.net mvc jquery paging plugin
The Who Can Help Me application is using ASP.NET MVC, Castle Windsor and MEF and NHibernate. Worth a look for any ideas..

3:

There are more than one possible approaches you might use depending on what you'd like to achieve.. Ditch Windsor in favor of MEF, if possible. If you don't use Windsor's more advanced features, you could easily use MEF instead of Windsor. (Read this post to see if it is suitable for you.). If you'd like to stick to both of them, read this. (Perhaps this is the same post you mentioned?). As Glenn wrote, it is perfectly reasonable to have both MEF and Windsor. Here's what I think:.
  • Windsor serves as an IoC container for the actual components in your app
  • MEF should be responsible for external components and 3rd party extensions in your app
This should also answer the questions this Glenn raised at the end of his blog post. (And btw, the comments are also worth to read, he says he has a working bridge for Castle.) Some more stuff you must find in this question.. Hope this helps..


71 out of 100 based on 56 user ratings 531 reviews

#