views:

33

answers:

1

I am trying to create a pluggable ASP.NET MVC framework. I have extensively used Prism (CAB for silverlight) and am a huge fan and wish to implement the following items in my pluggable ASP.NET MVC framework

  1. The framework will have a host to load the unity container and other infrastructure items like logging services and all.

  2. Plugins will be independent MVC2 application. Every application will have IModule interface implemented which will initialize and register Controllers/VIEWS(Is this possible!!!) type in Unity?

  3. This IModule will also register custom routes per plugin and add it to host Routes collection.

  4. When the application will start, the plugins list will be loaded from the database/external file and IModule of the project will be called which will load the above mentioned items in Unity Container.

  5. Whenever any request is made, the controller will be loaded from unity and the Views will be loaded (Is it possible that I register a custom view engine in unity which will point to physical path rather than embedding the resource in the dll)

Is this possible. The question may sound a bit stupid... :)

A: 

This is generally possible, though a lot of work from scratch. Fortunately Microsoft's Orchard project already does pretty much everything you are asking, and you can download the MVC source code to see how it's done. See: http://orchard.codeplex.com/

Clicktricity