We have a Seam 2 based web application with the usual user login and a couple of views which have handler classes interacting with a local database and a web service.
Now, we need to implement customer specific differences – so the use cases are basically the same, but for example customer A wants a couple more fields on the form, customer B a different web service call and customer C another role with different access rights.
I know my question isn’t very specific – but I’m looking for general ideas how to handle such a scenario without having to maintain different separate versions of the application or having lots of ifs in the XHTML or the java code for getting different behaviour.
So since this is I guess a common scenario – how do you handle it?
Fields
If the business case is the same and the fields don’t influence it directly you might just opt-in for a user- or companysetting. So just a checkbox which modifies the layout. Hard thing which you should be aware of is validation of required fields. Since that might differ between your customers.
A step further you could go for flexible fields and all that kind of things but that will get quite complex directly. If you don’t need to don’t go there.
ACL
The ACL could be just made flexible enough to support different settings per customer, that shouldn’t be a big issue.
Webservice
The other webservice: If it is another webservice but it gives the same info back you could just implement an interface. That way you could flexibly switch per customer. The nice thing is that your application get unaware of which webservice it actually is but it understands the interface. More on this: decoupling is the keyword.
This also generates a well testable piece of software which allows you to develop in the future further without much hassle.
Know when to stop
If it gets too far with customization understand where to stop. Don’t get into too many difficulties, when a customer want a customer piece of software it should become one at some point in time. See also: http://gettingreal.37signals.com/ch05_Start_With_No.php which is quite relevant, you can’t satisfy everyone with a standard piece of software. There will be lots of hidden costs: http://gettingreal.37signals.com/ch05_Hidden_Costs.php
Think that gives a well overview. If you need more details maybe separate this question because each of the three questions has it’s own issues.