wood burning stoves 2.0*
The moose likes Java in General and the fly likes Design Doubt - App Customisation for Customers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Design Doubt - App Customisation for Customers" Watch "Design Doubt - App Customisation for Customers" New topic
Forums: Java in General Servlets Other JSE/JEE APIs
Author

Design Doubt - App Customisation for Customers

Karthik Rajendiran
Ranch Hand

Joined: Aug 13, 2004
Posts: 211
Dear Sir/Madam

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

Option
a. For Functioanlity we have interfaces and each customer specific thing in different Implementation classes
Option 2

Can anyone suggest best practices in design patterns.


SCJP 1.4 SCWCD 1.4 SCDJWS 1.4
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4181
    
  21

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.


Steve
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Design Doubt - App Customisation for Customers