File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Data Transfer Object / Value Object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Data Transfer Object / Value Object" Watch "Data Transfer Object / Value Object" New topic
Author

Data Transfer Object / Value Object

Manoj Zachariah
Ranch Hand

Joined: Dec 08, 2003
Posts: 65
How do i create a DTO to pass multiple values between classes
David Peterson
author
Ranch Hand

Joined: Oct 14, 2001
Posts: 154
DTOs (Data Transfer Objects) are plain old Java objects. Nothing fancy, just a bunch of get/set methods. Don't define any business logic in your DTOs. All they do is hold data.
Hope this helps.
David Peterson
Sadanand Murthy
Ranch Hand

Joined: Nov 26, 2003
Posts: 382
Originally posted by Manoj Zachariah:
How do i create a DTO to pass multiple values between classes

Just like any other java class. All variables that hold the values for the various attributes (that you want passed to other classes) should be private (unless you want to create subclasses & want subclasses also to be able to directly reference these vars). You expose these variables (or the values they hold) via get/set methods (ex: getCustomerName(), setCustomerName()).


Ever Existing, Ever Conscious, Ever-new Bliss
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Data Transfer Object / Value Object