Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Bad Programming Practices 101 (e-book) this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

URLybird  RSS feed

 
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

is it ok to encapsulate a record into an object named room, that consist of
hotel name, location, etc..
what is the good class name to encapsulate a record?

thanks
 
Ranch Hand
Posts: 1033
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Beny Na:
hi all,

is it ok to encapsulate a record into an object named room, that consist of
hotel name, location, etc..
what is the good class name to encapsulate a record?

thanks



I do that in my GUI code, such an object is using the Transfer Object pattern, also known as the Data Transfer Object, DTO, or Value Object pattern.

I don't use it over RMI since the instructions indicate that the DBAccess interface should be used, it passes an array of Strings. In a real system I'd use the Data Access Object pattern as well.

I just call the class Room.
 
You've gotta fight it! Don't give in! Read this tiny ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!