• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The concept of ValueObject

 
Sanz Vai
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What exactly is a valueobject?
Isn't everything in Java passed by reference???
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, but what happens in a typical J2EE application where the web tier and the app tier are separate JVM instances? Do you know how objects are passed between JVMs? Think about it
 
Sanz Vai
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know the objects are serialized while passing to a diff JVM. Only a copy of the object is passed? But in any case, what's SO special about these VOs? A POJO is no different than VO, right?
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you are correct. Typical implementation of a value object is a POJO. However that does not preclude someone from implementing other forms of value objects. For instance, you can use an attribute hashmap pattern as a value object, or an XML DOM tree as a value object.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic