6

Basically the scenario is this:

  • There is one main version of an application, but it is modified for each client. The development is usually through the version that is currently worked on.

  • All the other versions should be updated after adding new features or bug fixes.

  • Application is written in ASP.NET MVC C#

  • Git is used for source control and there is one server version for each project. Branching is used mainly for working on different features.

Here are my thoughts on the problem:

Since the current modified version is the latest one, when I add a feature, I have to somehow add it to all of the other projects. Same goes for fixing bugs. Doing that manually is out of the question, so I guess I have to use some complex way of version control and merging?

Is this is even possible to pull off? I fear that at some point (20 versions) it will be impossible to keep up with what's where. The problem is, I don't see any other solution...

EDIT (There aren't many propositions for solution in this or the other topic ):

As you guys said, it is a bad idea to have many versions, and it's best to have one body-of-code which can handle all of the scenarios, but there wasn't much said about how to accomplish this.

-Someone said that modular (plug-in) design would be good, but this really isn't the case, since there will be many modifications to existing code.

-using #if ?

-using config files ? How does this work exactly ? I wasn't able to find any examples.

6
  • 5
    Exert any effort you can to escape this toxic situation. If you can't get your organization to adopt sane practices, i.e. configuration instead of code duplication for each client, leave. Seriously. Nov 5 '14 at 10:22
  • 1
    @KilianFoth Believe me I'm trying. I actually showed your post and I guess something is getting through :)
    – cah1r
    Nov 5 '14 at 10:49
  • 1
    Have you thought about a addon system, configfiles or shake #if? The last one is probably the worst solution possible, but it is at least one :/
    – Knerd
    Nov 5 '14 at 11:26
  • 1
    @Knerd Yes I thought about it. I will check which solution is the best. Can you think of anything else that can be used ?
    – cah1r
    Nov 5 '14 at 11:32
  • 2
    @Knerd The scenario I described is in the future. Now there aren't 20 versions. Only 3 and it's the moment where the changes have to be made and everything unified and I sincerely hope they will listen :).
    – cah1r
    Nov 5 '14 at 11:57
16

General suggestion : DO NOT USE VERSION CONTROL ! (for this kind of problem)

Either make it so the application has all features that can be turned on/off using config files.

Or make the application modular so each customer gets slightly different modules.

3
  • 2
    do you know of any good resources for creating a modular based system such as this with C# MVC? I'm facing a similar dilemma with a product I am currently developing. Nov 5 '14 at 12:14
  • 1
    @Euphoric Can you propose specifically what can be used to solve this problem ?
    – cah1r
    Nov 6 '14 at 10:22
  • @MateuszMigała -- In general, your job is to sell it to your company, and explain that not doing it amounts to them shooting themselves in the foot. Tools that can be used are Domain Driven Development, Domain Specific Languages, Table-Driven code, the book "Refactoring to Patterns" by Joshua Kerievsky, and other "Refactoring" literature. As you refactor, you will understand, remove duplication, and finally be able to change the behavior of your application by configuring it. Then the configuration for each client goes into version control. Done. (Until the requirements change ;-). Feb 20 '20 at 16:14

Not the answer you're looking for? Browse other questions tagged or ask your own question.