• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Different client view in J2EE app

 
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If the changes are really radical you could go as far as providing a separate WAR for each client - I'm assuming most the logic is implemented in an EJB tier. However, that would really trample all over the DRY principle and could be a maintenance nightmare.

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.
 
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I dont think even changes are critical, separate WARs for client is a good fix.

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

Regards




 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

According to me using Sturts tiles will be the best option to address this requirement.

Thanks,
Ramesh
 
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think the easiest way is to use dynamic views, this views display differently based upon client preference.

In view layer, you can read client preference and render differently.
 
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.

Regards
Ashwin
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could also use the ApplicationController pattern to handle different kinds of clients like Rich-GUI clients (Swing/AWT), Web clients.
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic