• 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

"Presentation" beans in a web environment

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Suppose I have the following two tables:
USER (id, name);
MESSAGE (id, body, user_id);
Now I want to present a table containing the user's name and the message's body in relation. This presentation is a webpage. I have for example two beans: User and Message containing properties that represent the corresponding tabledata. Is it acceptable to create some kind of "presentation" bean that has te properties:
String name and String body? These "presentation" beans are in fact dataholders that are only used for presentationcomponents.
What do you think of this?
Thanks and cheers,
Jeroen
 
sharp shooter, and author
Posts: 1913
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Certainly - you're basically just building a composite view onto some of the data in your application. Doing this makes it easy to understand and increases performance by bundling up related data into one package.
However, one of the downsides to this is that you can go and create these types of objects all over your system, eventually leading to lots of potentially duplicate and unmaintainable classes.
HTH
Simon
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic