Search code examples
c#javascriptmodularity

How can I make a program to support custom requirements for multiple customers with a single codebase?


As the title states, I'm looking for a way to organize code with various customer "settings" that control program logic and sometimes display logic without introducing a nest of if/else branches in both the client (javascript) and the server (C#).

What mechanisms do I have to choose from for making a series of modules used for validation, field visibility, processing rules and such that can be loaded dynamically based on, say, a username or other bit of customer data? I am aware of IOC, I need something more specific than "configurable modules". Are there libraries out there to provide a structure for organizing code and loading it conditionally?

What about in javascript? Are there well-known mechanisms for dynamically loading javascript from small files to be executed conditionally?

Most of all, is there a name for what I'm describing? I don't want a rules engine or decision engine where the code is stored as a set of values and operators. I want to keep the code in its original files. I also want to use strong typing and interfaces where I can.

Any ideas?


Solution

  • You should look at either (or both) of

    Here's the MSDN docs on the System.Addin namespace(s) as well: http://msdn.microsoft.com/en-us/library/gg145020.aspx

    This discussion talks about the difference between MEF and System.Addin: Choosing between MEF and MAF (System.AddIn)

    The wiring and configuration of your extension system is of course highly domain specific.

    Good Luck!