We have a J2ee Application , kind of product.
Initially designed for a customer, now the product is asked by different customer, each have their own small customizations.
Developers have put If(Conditions) in the code for the customer, but we feel ,we need to arrive at a design pattern or kind of design
to cater to different customers and at the same time maintain the product in long time
a. For Functioanlity we have interfaces and each customer specific thing in different Implementation classes
Can anyone suggest best practices in design patterns.
It depends on what type of customization you are talking about. If you are talking about cosmetic changes, then the goal would be to take everything that is 'data' and remove it from your code, put it into other resources:
1) Push 'things that change' into configuration files. These tend to be email address, links to other sites, people's names... Also database configurations.
2) Use resource files whenever you can. Icons, button backgrounds, etc... can all be stored in resources, then attached to the application at run time (maybe referred to in a configuration file)
3) Make heavy use of CSS for the look and feel of the application, and keep the CSS open and available to be changed.
4) Use JSPs for the page layout. Make sure you keep them HTML templates only - with no business logic or code - simply display. Then the layout can be customized easily without fear of changing function.
Things get more complicated if you want to customize application functionality. In this case, you are probably best looking into 'Dependency Injection' and one of the many frameworks which provide J2EE implementations for it.
subject: Design Doubt - App Customisation for Customers