views:

142

answers:

2

By opinionated I mean that the framework will lock you to follow certain conventions or technologies or architectures. Something similar to Rails or Django. This will make building deeply-integrated plugins possible.

One of the major advantages of using Rails/Django is the gems/plugins. As you know, you'll find a gem for everything: admin pages, authentication, comments, rich helpers, etc...

Currently, MVC can mimic that behavior to an extent with the use of DLLs. However, as far as I know, MVC doesn't have a standard architecture that will allow deeply integrated plugins -- for example, we cannot have a comment system, because to save comments you need a repository, and a typical MVC project can be using L2S/EF/NHibernate/MongoDB/etc.

It seems to me that a good way to do this is to:

  • Establish a central "core engine" project that employs MEF
  • The core engine will expose:
    • Container/Service Location
    • Few interfaces (like IRepository)
    • Some "hooks" like ApplicationStart plus every other hook/event you can think off
    • What else?
  • To use this
    • Add reference to the "core engine" binary
    • Set some the configurations (an example would be an instance of IRepository)
  • A developer is now able to include any plugin that depends on the "core engine", and those plugins will have complete access to the app events and repository
  • Obviously, plugin developers will be developing plugins that are targeting the core engine -- they never talk directly to the app, and the engine is the middle ware between the two.

The goal is not to have The Perfect Enterprise Web Framework... but instead is to build something like what Django and Rails have and MVC seems to be missing: high reusability of heavy but popular components.

Has this been done before? is there a better way to do this?

A: 

I think the Orchard project may be similar to what you are looking for.

Daniel Plaisted
Orchard looks more of a CMS than a web framework. Plus it's not built on top of MVC.
ANaimi
+1  A: 

You might want to look at what MVC Turbine offers. It's not everything you mentioned, but it would be a good starting point.

Ryan