• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Differences between Value Object und Transfer Object

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Everyone,

what are the differences between Value Object and Transfer Object?

Thanks a lot!
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sun's Pattern Site says Transfer was formerly known as Value.

The Portland Patterns Repository on Ward's Wiki says Value Object is something entirely different. I bet that's the reason Sun changed their name to Transfer Object. Quote: "Their identity is based on their state rather than on their object identity. This way, you can have multiple copies of the same conceptual value object."

I'd use Transfer or Data Transfer for the Sun definition.
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Stan James:
[QBThe Portland Patterns Repository on Ward's Wiki says Value Object is something entirely different. I bet that's the reason Sun changed their name to Transfer Object.[/QB]



Yes. Unfortunately, they still insisted in using their own name, instead of the already prevalent "Data Transfer Object".

See also http://faq.javaranch.com/view?DataTransferObject
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This topic Value Object (VO) vs. Transfer Object (TO) vs. Data Transfer Object (DTO) may be of some interest.
 
Elena Taube
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could you make an example for VO and TO? Thanks a lot!
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Elena Taube:
Could you make an example for VO and TO? Thanks a lot!



A simple bean, better say POJO, can be your transfer object.
 
Ilja Preuss
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Adeel Ansari:

A simple bean, better say POJO, can be your transfer object.



POJO is a more general term - a VO will typically also be a POJO.

String and the wrapper classes Integer, Byte etc. are good examples for VOs.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ilja Preuss:
POJO is a more general term - a VO will typically also be a POJO.

String and the wrapper classes Integer, Byte etc. are good examples for VOs.



Indeed, but I thought it might confuse somebody. Like, Integer and String can be a POJO, can you explain it how. I believe POJO is a likely term and many design pattern tutorials and books used POJO as an example of a VO instead of Integer, Byte and Strnig. So, if anybody pick some tutorial it is likely that he/she would get the thing.

Nevertheless, Intger, Byte, and String etc. are good examples of VO is worth mentioning.

I'm not contradicting in any manner. I dare not.
 
reply
    Bookmark Topic Watch Topic
  • New Topic