ASP.NET MVC 5 Modular Web application Architecture?

11,612

Solution 1

Having separate project/assembly for each module and delivering it as Nuget package is definitely a good strategy.

Advantage:

  1. Can maintain and release multiple version. Different client get different version.
  2. Installation of latest or specific version supported through Nuget. This helps during development where App A developer can target 2.0 version of module A while App B developer can target 1.0.
  3. Single source base with separate branches for each version. Client using 1.0 request a change will get code from branch 1.0 with just the fix requested.
  4. Each module can be released or updated independently.

Challenges:

  1. During development debugging assembly code that's installed using Nuget. Nuget supports it inbuilt. We achieved it in our case (Framework being used by multiple platform).

  2. Code changes required in module code (a bug or a new feature required). Well this is tricky:

Option 1: Same developer just go ahead and make that change, create new package and install new version in his app. Got to authorize the change as it is critical code.

Option 2: A designated team responsible to fix issue or change request in framework code.

Solution 2

You can also try using the plugin architecture, just build the different modules that makes up the application as a plugin, then build the module that is required for every application as a single code base. In this case, installing a component for any particular user, will be a matter of adding or pulling out plugins. Many large projects makes you of this particular architecture as it reduces copy and paste, increases and reuse and speed of development. You can check nopcommerce an open source project for an idea of how it is done.

Share:
11,612

Related videos on Youtube

yoerids
Author by

yoerids

Updated on June 26, 2022

Comments

  • yoerids
    yoerids about 2 years

    The company where I am currently employed is struggling with an architectural decision for our range of applications. At the moment we have a couple applications that have common parts (think like a calendar module). Until now we kept on copying code from other existing application, but in the future we want to evolve our applications to a more modular design:

    Our situation

    As you can see in the picture above it is possible to have different versions of modules per application.

    We are considering to possible solutions:

    • Building a core application framework where we can install our modules in. We're think about a tool like Nuget to accomplish this.
    • Building one application where all our modules are included in (=one code base), but the customer only gets the functionality that is activated for him. We're forseeing some problems with versioning here.

    Any suggestions on this? We can't be the first company who struggles with this problem?All our applications are ASP.NET MVC 4/5 web applications, built with Razor Templates or JavaScript templates (knockout.js). All of our applications are deployed on Microsoft Azure and we have extensive inhouse knowledge of buildscripts (MSBuild), CI Servers...

    • mattytommo
      mattytommo over 9 years
      I've worked in a previous position with a similar setup. What we did was have one all-encompassing solution that includes all of the projects. The reusable elements of your applications would live in a shared project in the solution referenced by each of your web applications. The one thing that this doesn't address is different versions of modules, why is this the case? I think that it's only going to cause you headaches in the long run. As for access to different modules for each client, that'd be governed by your permissions/security structure in your application.