Field and cell widgits will be able to construct and deliver Whole Value to the domain model. As is normal practice in object-oriented programming, the domain model is free to extract, interpret or reject any information it is presented. This pattern considers the domain model's modest obligation to explain such selection.
You can expect values to be entered in small batches followed by a quick review looking for transcription or typing errors. This cycle repeats but not always with the same batch boundaries.
Since you will have no way of knowing exactly when a review takes place (it can be just a quick glance) you must inform users of their success entering values as each field or cell is processed and you must provide this information without disrupting the cycle when problems occur.
Therefore:
Provide for the read back of any information written into a domain model. Expect field and cell values to be retrieved and echoed immediately after each entry.
Answer reconstructed values using a protocol trivially derived from the original. Note: the usual getters & setters convention (i.e. attribute and attribute:) meets this requirement though the requirement applies to more than just attributes.
The full turn around echo of entered values allows the user to observe any selection or interpretation of entered values.
Do not expect the domain model to explain its interpretation of marginal or incorrect values through notifiers. Such initiative on the part of the model is misplaced because it breaks the small batch entry behavior.
For example, consider the entry of a pay date:
user types: 5/8/94 echo back: 05/08/94
The whole value May 8th, 1994, standard format.
user types: 5/5/94 echo back: 05/08/94
The model has chosen nearest payday, always a Friday.
The leading zeros appear for the simple reason that the original six characters entered are discarded and replaced with the standard print representation of the date echoed back by the model.
In the second case the actual numbers are different because the model has chosen to handle bad input by choosing to store the closest legal input in its place. The echo back makes this choice visible.
Equally justifiable alternatives would be for the model to ignore the bad value or accept it unconditionally, possibly as an Exceptional Value.
Our point here is not that one choice is better than another but that the choice once made must be visible to the user without disruption. Following this point of view further, meaningless setters would be ignored and meaningless getters would print as blank.
This pattern counters the common practice of ringing bells and flashing lights at the first sign of trouble. You will have plenty of opportunity to protest bad values in Deferred Validation.
DOT FROM preview-next-diagram