This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes URLybird Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "URLybird" Watch "URLybird" New topic
Author

URLybird

Beny Na
Ranch Hand

Joined: May 26, 2004
Posts: 159
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
peter wooster
Ranch Hand

Joined: Jun 13, 2004
Posts: 1033
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: URLybird