 |
Value Object
Meaning 1: equals and hashCode based on field values
The equals and hashCode methods use field values instead of the default behaviour of using the object's memory address.
There are many examples of Value Objects in the standard library, e.g. Integer and String.
Note: Value Objects are often also Immutable Objects.
Meaning 2: data-centric classes
Value Object (VO) is an informal term used to describe data-centric classes which model a given problem domain.
In the case of a database backend, a Value Object will map roughly to a record in a database table. The fields of the VO will map to the various columns in the table.
Synonyms : Data transfer object (DTO), Persistent Object, Storable.
Also see
Hmm...There might be two ideas here, not one. Value Objects are not necessarily related to a persistence mechanism.
-- JohnOHanley - 23 Jul 2003
|