Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

"Presentation" beans in a web environment  RSS feed

 
J.H.B. Oosterlaar
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • 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
 
Simon Brown
sharp shooter, and author
Ranch Hand
Posts: 1913
6
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!