A client creates new Value instances. Necessary data for initialization is provided as part of the constructor call or through a special initialization protocol. No state-changing methods should be published to clients and be used by them, even if these methods are public.
A Value instance provides information to a client through read-only query methods (a.k.a. observer methods). For what would traditionally be state-changing methods, the value object creates a new instance of its class and initializes it with the data that represent the result of the computation the current method is supposed to carry out.
A client that calls a command method of a value object receives a new Value instance back; it typically drops the old value object and keeps computing with the new value. Most notably, if the value is stored in an attribute of the client, the client replaces the value object representing the attribute’s value with the new value object.
Next