Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Value Object v. Transfer Object

 
Dan Huskins
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anybody shed some light on any differences between Value Objects and Transfer Objects?

These terms sometimes appear to be used interchangably; sometimes not.
 
Marie Pierre Courbevoie
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the context of transferring data between tiers, the two terms have the same meaning. In the recent J2EE jargon, DTO is preferred.

Marie Pierre
 
Hermano Pereira Carneiro Soares
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no differences.
 
Praveen Nagpal
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, I will not agree that there are no differences. Custom Value Objects (CVOs) are generally designed as input and output value objects. They are considered immutable. Whereas, Domain Transfer Objects DTOs are generally used within the application and are made mutable as they are provided with their own setter methods.

However, there is a thin line between the 2 types of objects and is left to the interpretation of the designers.
 
I Roberts
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Sun Core J2EE patterns book has an explanation for both and their differences. Basically, the Value Object is used within a domain model while a Transfer Object (Data Transfer Object outside Sun) is used to transfer data across application boundaries (i.e. application architecture layers).

Refer to the book.
 
Tony Tranquil
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My understaning is that the difference for these two Objects is from the Serilizable interface.
 
I Roberts
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is highly likely that the parent or indirect parent of a Data Transfer Object will have use the Serializable interface as its purpose is to be used across application architectural tiers and therefore potentially hardware boundaries. However, this is not the definition of a DTO as these are also used in non-Java applications and are not specific Java.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic