• Post Reply Bookmark Topic Watch Topic
  • New Topic

def of Value Object Pattern  RSS feed

 
raghuram bikkani
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is meant by Value Object Pattern
 
karthikeyan Chockalingam
Ranch Hand
Posts: 259
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Value Object helps in representing related values as a cohesive unit. Assume you wish to get an address. The address can be represented by a class called Address as

Any instance of this Address may be termed Value Object or Data Transfer Object.

Advantage : The below code of invoking a method of some class like
is clumsy. What if in future more detail is added ? Representing the data as a value object simplifies the above method signature as

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!