2

I am working on a Symfony 4 rest API application which will be use by multiple client(about 20 different clients). Each client has his specific needs so I have to fork the web application for each client in order to implement the specific needs. For example, the PriceController which manage the pricing policy will have a customized implementation for each customer. I evaluate to 80% the common code and 20% of customization for each client.

My idea is to create a base application with all the base code and for each client, fork the base application and use the concept of bundle/namespace to extends the base classes in order to add the customization.

For example, I define a Core/Controller/PricingController.php in order to manage the pricing policy. For a Client CorporationA, I create a CorporationA/Controller/PricingController.php and for another client CorporationB I create a CorporationB/Controller/PricingController.php which both extend the Core/Controller/PricingController.php.

If I have to implement a specific behaviour just for the CorporationB client, I add the specific code in the dedicated class.

What is your opinion about that ? Do I have to manage the customization in a different way ?

Thank you for your help.

1 Answer 1

0

This pattern will lead into a giant copypasta clutter. My former employeer sold an application to ~30 customers, which all had their special needs. Everyone of them had its own branch which was maintained separately. So every bug had to be fixed 30 times. Over time, nobody could tell you which version conatained what. The biggest mess imaginable.

If you want to do it right and clean, implement everything as a feature or as a plugin system.

2
  • For me, if I have to fix a bug for all the 30 customers, I just have to fix it in the Core controller (common to all customers because all controllers extend the core controller) and each customer has just to update/pull his branch to get the core code fixed.
    – Moran_bzh
    Sep 12, 2019 at 15:40
  • 1
    Ok, this is not as worse as maintaining 30 full branches. But I would design it as one product/solution with Features/Plugins.
    – user334372
    Sep 12, 2019 at 15:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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