How to separate and maintain customer specific code
- by WYSIWYG
I am implementing customer specific code and currently following simple approach like if (cusomterId == 23) do it. I want to separate out all the customer related code in separate place. But I have following problems.
In code is in
1. Stored procs
2. Plain old classes.
3. Controllers
4. Views
I came up with two solutions.
First is to create table CustomerFunctionlity with columns CustomerId, FunctionalityName, method/Proc, inputs/outputs
With this table I can simply check if exists, execute given function.
Another way is creating a factory which returns customer related object for an interface.
I am writting small end to end customer specific functionalities. How can I write maintenable code.
Thanks