ASP.NET MVC 5 Modular Web application Architecture?

yoerids picture yoerids · Feb 4, 2015 · Viewed 11.4k times · Source

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...

Answer

SBirthare picture SBirthare · Feb 4, 2015

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.