locked
Multi Client application - best practices for maintaining code?! RRS feed

  • Question

  • User1251575523 posted

    Hello,

    I'm going to develop a Web Application (should be in MVC but may be in ASP.NET), C#, .NET Framework 4.5, with SQL Server Database system.
    Initially, this app will be fully installed on Client A and will suit the needs of Client A. 
    In the future, I will want to sell this to Client B, C, D... 

    Now, although I'd like to have this application be unique in terms of code, I know it will have to be tweaked to fit the needs of each client, this means, between the Web App, Business rules, Model, Data Layer and Database, I estimate that (thinking long term), 75-80% will be the same and the remaining 20-25% will vary from client to client.
    Imagine this as some sort of application that manages salary payments within a company. Every client will have its own internal rules, taxes and regulations may change from country to country, etc...

    I have no idea, what is the best way of going about this in terms of maintainability, scalability, source code, etc...
    I would like to have this under 1 solution if possible, but I understand that may be "impossible"

    I'm sure this has happened before. Any pointers on what to do OR not to do in this case?!


    JB
    Cool

    Wednesday, December 11, 2013 8:20 PM

Answers

  • User-488622176 posted

    I'd consider building a multi-tenant web application. Isolate everhting that is modifiable per customer and make it part of the configuratoin. In this scenario you can store all customers in different dbases, with one dbase for authentication/authorization use, and info on the instance to use for each connected user.

    If you have a multi-country setup, you should make a layered application:

    • one core layer, with customisation points
    • one layer with customisations per country
    • for every customer in a country : other customisations possible
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, December 12, 2013 12:25 PM

All replies

  • User-488622176 posted

    I'd consider building a multi-tenant web application. Isolate everhting that is modifiable per customer and make it part of the configuratoin. In this scenario you can store all customers in different dbases, with one dbase for authentication/authorization use, and info on the instance to use for each connected user.

    If you have a multi-country setup, you should make a layered application:

    • one core layer, with customisation points
    • one layer with customisations per country
    • for every customer in a country : other customisations possible
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, December 12, 2013 12:25 PM
  • User1251575523 posted

    Thanks for the feedback... "multi-tenant"... I heard this term in the past but I couldn't remember how to call it.
    I've checked out some posts online, but, they're talk more on having different UI for each client.
    I will need different everything:
    - Web App
    - Business Layer
    - Data Layer
    - Database

    Do you know of any good examples I can learn from? 

    Thanks

    Thursday, December 12, 2013 5:11 PM
  • User-488622176 posted

    Well, take a look at Microsoft Dynamics CRM. It is one of the best examples I know. It has a solid architecture, flexible, multi-tenant, ...

    In your case, you shoud take care of:

    • Entity model with entities & relations that are modifiable (runtime design environment). They should be "mapped" to a database model (different approaches possible)
    • Data layer needs to be generic (as underlying model is generic). It should translate dynamic object structures into a varying data model. ORM can be of some use, but you'll need a lot extra
    • Business layer => What do you want to be flexible
    • Web App : to have max flexibility : create a "view" layer that is modifiable in the runtime design environment, and is based upon the dynamic database scheme. Parse these views at runtime, translating them into HTML 5 UI with MVC 

    Few lines, huge amount of work :-)

    PS: basic sample, not bad to learn : CoEvery CRM (http://coevery.codeplex.com/)

    Friday, December 13, 2013 8:07 AM