4

I need to write a web application with ASP.NET MVC 3 that should be completely modular and extensible. A module/extension would be, for example - a forum, a blog or a content module.

I thought about using multi-project MVC areas for this purpose, so I have an Extensions/ directory with the .dll-s of the extensions, and on Application_Start (or maybe on an earlier step), it loads all the extensions in that directory to current AppDomain.

Is there any better way to do this? I mean, maybe not using MVC areas at all? Maybe using MEF? I have a very little experience with MEF, and I'd like to learn, but I just don't know if that fits my project. Maybe using MVC Areas + MEF?

As you can see, I'm pretty confused and would like to have a clarification :)

Thanks.

Alon Gubkin
  • 56,458
  • 54
  • 195
  • 288
  • Take a look at the SharpArchitecture and "Who Can Help Me" sample application. http://whocanhelpme.codeplex.com/ – Oded Mar 15 '11 at 22:24
  • Also, see this blog post Q&A about "Who Can Help Me": http://jamesbroo.me/who-can-help-me-q-a/ – Oded Mar 15 '11 at 22:27
  • 1
    This pretty broad. What are your requirements? Your talking about exchanging views, the database and business logic. Thats a pretty huge topic. Who will be writing these modules? Are you sharing users? – John Farrell Mar 15 '11 at 22:38
  • @Oded - I'll look into it tommorow, thanks. @jfar - I'm talking about exchanging the business logic only. – Alon Gubkin Mar 15 '11 at 22:44
  • 2
    Take a look at Orchard (http://orchardproject.net). If it's not suitable for you then check out the code and you may get some ideas from how they do it. – David Glenn Mar 16 '11 at 08:12
  • I second looking at Orchard. It will give you some ideas as to how this can be achieved - Orchard itself is designed to be very modular in extensible in a fashion similar to the question you have asked. – Russ Cam Mar 16 '11 at 12:30

2 Answers2

0

I'm looking into something similar. I've yet to start but so far I've read this which seems promising.

It appears that MVC3 has specific interfaces for IoC, so you want to spend most of your time looking at MVC3+MEF examples. Some of the older examples are less relevant.

If you want your views to be easily extensible then this seems like a good idea.

Tim
  • 7,746
  • 3
  • 49
  • 83
0

I've done quite a few topics on using MEF with ASP.NET MVC. It works quite well, but it is not as polished as say portable areas in the MVCContrib project.

MVC3 + MEF: http://www.fidelitydesign.net/?p=259

MVC2 + MEF: http://www.fidelitydesign.net/?p=159

Matthew Abbott
  • 60,571
  • 9
  • 104
  • 129