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

Value Object Participants

Created by Dirk Riehle. Last edited by Dirk Riehle, 2 years and 110 days ago. Viewed 209 times. #10
[diff] [history] [edit] [rdf]
labels
attachments
Superseded by Value Object Participants v2.

The Client class uses Value instances like built-in datatypes (to the extent that this is possible with your implementation language). Whenever the Client wants to change the value of one of its attributes, it replaces the attribute object rather than changing it. You write code like

attr = attr.calculate();
rather than
attr.calculate();

The Value class represents a domain-specific value type. It is implemented such that Value instances are immutable objects, meaning that its instances cannot change their state. Rather, as the result of some computation, a new Value instance with the desired internal state is returned.

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