Standing on the shoulders (well, maybe feet) of giants
[ start | index | login or register ]
start > Value Object Applicability v2

Value Object Applicability v2

Created by Dirk Riehle. Last edited by Dirk Riehle, 2 years and 74 days ago. Viewed 451 times. #3
[diff] [history] [edit] [rdf]
labels
attachments
Use the Value Object pattern if
  • the domain concept you are implementing represents a value type
and if
  • the resulting class does not become too heavyweight as to slow down performance significantly.
We say that we implement “value objects” using a “value object class” that represents a “value type” as derived from modeling your application domain. Value type means the same as data type, but is more specific.

It would best if programming languages had language features that explicitly marked classes as value types, for example, by using the keyword “valuetype” rather than “class”. (This is finally in the making, see IBM05, SUN06.)

The Value Object pattern is widely applicable. Value types are as fundamental as object classes, making the distinction between values and objects explicit. Examples of value types in the financial services domain are monetary amounts and currencies, in the Internet domain they are protocol names, domain names, and URLs, in math they are percentages, explicit fractions, and integrals, and in engineering they are the metric system and its units.

Next

one comment (by Dirk Riehle) | post comment
Copyright (©) 2006 by Dirk Riehle or the respective authors. All rights reserved.