Asp.net mvc modular howto app / recommendations

Does anyone have any recommendations on creating an ASP.Net MVC application in a modular module? I mean some blogs / tutorials, etc. I just read the Hammet MEF and ASP.NET MVC sample blogpost , but I don't find MEF mature enough to use it in production yet. I could not post other relevant posts on this topic ...

I know that I can achieve modularity that implements a custom ControllerProvider and some mechanism for checking plugins, but I would like to learn some more approaches / best practices before I start redefining the wheel :)


The modularity, which I mean by this topic, should cover only the point of view of the web application - nothing more than a modular model of the application / service, etc. I would like to find the best possible way to split a single web application into several assemblies that will contain additional controllers, views, resources, JS + CSS files, images, etc. Thus, there should be some basic web application project that will search for available embedded builds of web applications, download them, publish their controllers, provide their views and other resources, and perhaps prepare some menu with an entry for each web module applications.

I do not want to discuss any plug-in architecture of the model + services here - only part of ASP.Net M VC .

+7
asp.net-mvc
source share
7 answers

MVC Portable Areas may be a good solution to this problem

+1
source share

Modularity is a fairly broad concept, and I think the answer to your question simply needs to be subjective. What you are asking is an architectural solution, and there is no one good way to do this. Depending on the project, you may have different priorities and the importance of different parts of the system. I think that the MVC pattern provides enough separation of problems, which is actually the goal of every modular architecture.

If you want to easily plug in new modules in an existing application, how do you define a module? I think you should narrow the question down a bit to get some obscure and meaningful answers.

+3
source share

Partial query support for rendering part 3 controllers is fully supported in MVC, see this post: http://blog.codeville.net/2008/10/14/partial-requests-in-aspnet-mvc/

Obviously, a module in MVC will contain at least a controller and one or more views. But perhaps what you wanted is just a few, and therefore, it’s much easier to rewrite the controller than if it were the traditional WebForms architecture.

Or maybe you want to replace the data source, just override the methods in the Model object and you are up and running. This is the basic basic principle in MVC that you separate the various levels of logic and that you are FORCED for this, unlike WebForms, which still allows you to execute SQL directly in your view if you reference.

(This MVC also supports it not by design, but by inheritance.)

+1
source share

I found an article that addresses some of the basic requirements that you are talking about. Unfortunately, the article was a year old using ASP.NET MVC 3, so I rewrote it and tested the methodology to work with ASP.NET MVC 4. You can read it here .

+1
source share

The main arguments for modularity are always the same ...

  • Testability
  • maintainability
  • Easy to deploy
0
source share

As a starting point, you can take some ideas from this article:

Spark View Engine - Modular

And an example code:

spark / src / Samples / Modules

The code is in the tree of the Spark View Engine tree (this is a very beautiful and powerful project), but it has nothing to do with it. He uses a lock to create dependencies and all that.

By the way, I was busy with MEF, but now I really do not see any advantages, and what I needed to do can be done using Castle and some tools (helpers for assembly requests and the like).

0
source share

I understand that this question has already been answered. But I was looking for answers to more relevant answers on this topic. I looked at the Regions as offering the original answer, but also came across the following links ( Part 1 and Part 2 ) from Liviu Ignat, who answered this question from the point of view of the plug-in.

0
source share

All Articles