If you're going to have heaps of clients, and they all want to customize their view, then maybe you could try using a kind State pattern object. Store client preferences in a database table mapped to an entity. Based on the current client use the entity as a kind of 'state' which gets delegated to when determining if a component gets displayed. This way you avoid an explosion of nasty conditional statements all over the place. If you're using JSF it'd be a piece of cake to hook this into the 'rendered' property.
I recommend an Intercepting Filter for selecting the view for each client. Easiest way is repeating the view of changing pages for each client type.
Without doing everything from scratch you can go for a framework like SiteMest http://www.opensymphony.com/sitemesh/. That will help to minimize the repeatings
According to me using Sturts tiles will be the best option to address this requirement.
In view layer, you can read client preference and render differently.
Vicky Pandya wrote:I have an application which requires different view per client. Currently application is being used only for one client and now is expanding to support multiple clients. Although basica functionalities of the application remain same client wants to see Home page and otehr pages most customized per their preference. E.g. Client A wants to see their business specific attributes and things on pages whereas client B as its own list of things it want to see on all pages. what's the best way to achieve this?
Your description is too abstarct.. What exactly do you mean by different clients want different things on the pages? Can you be more specific about the requirement ? Is it just different customizations of the page from a UI perspective or is it customizing the core data/functionality on each page or something else ?
Approaches could vary in their complexities based on what you want to do.
i thik composite view pattern could be applied as well,i what is required is varing client view based in security roles and other policies,such location and intenationalization.Combinatios of Front Controller, State and Composite View could help to achieve this goal.