CHECKS: A Pattern Language of Information Integrity


By: W. Cunningham
Published in: PLoPD1
Pages: 145-155

Url: http://c2.com/ppr/checks.html

Make validity checks on data.

Category: Business Computation, GUI Development

Summary: Make validity checks on data.

Pattern: Whole Value

Pages: 146-147

Reuse the literal values in a programming language and construct new objects that represent the meaningful quantities of your business. Use these values as the arguments of their messages and the units of input and output. Be sure these objects capture the whole quantity, not just magnitude.

Category: Business Computation

Pattern: Exceptional Value

Pages: 147-148

Including all business possibilities in a class hierarchy can be confusing, difficult, or inappropriate, so extend the range of an attribute beyond that offered in Whole Value. Use one or more distinguished values to represent exceptional circumstances and simplify the domain model hierarchy and method structure.

Category: Business Computation

Pattern: Meaningless Behavior

Pages: 148-149

Whole Values can exhibit subtle variations in behavior, and Exceptional Values can appear throughout the computations. Methods may stumble in circumstances you cannot foresee. Write methods without concern for possible failure. Expect the input/output widgets that initiate computation to recover from failure and continue processing.

Category: Business Computation

Pattern: Echo Back

Pages: 149-150

Users enter data in small batches. The cycle is repeated but not always with the same batch boundaries. Inform users of their success in entering values as each field or cell is processed. Echo back field and cell values immediately.

Category: Business Computation, GUI Development

Pattern: Visible Implication

Pages: 151-152

Combine Echo Back with methods that compute attributes to simplify some entries and improve the effectiveness of visual review for others. Compute derived or redundant quantities implied by those already entered. Display the computed values in fields or cells alongside those that are changed. Expect Meaningless Behavior when something is incompletely specified.

Category: Business Computation, GUI Development

Pattern: Deferred Validation

Pages: 152-153

You're using Whole Value and Echo Back. These checks are immediate on entry. Delay detailed validation until action is requested.

Category: Business Computation, GUI Development

Pattern: Instant Projection

Pages: 153

As you collect information for future use, you can use Visible Implication for user entries. Offer to project the consequences before the publication is made.

Category: Business Computation, GUI Development

Pattern: Hypothetical Publication

Pages: 153-154

A complicated domain model might pass Deferred Validation but still in be doubt. Consider an elaborate mechanism for detecting mistakes. Allow the user to make any number of hypothetical publications that can be released in a controlled way.

Category: Business Computation, GUI Development

Pattern: Forecast Confirmation

Pages: 154

When real-world events can be anticipated, generate appropriate computer models and publish them for public use. Adjust and confirm values associated with mechanically published events.

Category: Business Computation

Pattern: Diagnostic Query

Pages: 155

When you use Whole Value and Exceptional Value, you accumulate useful information. Incorporate mechanisms for the diagnostic tracing of every value in the system. Where rules and formulas have been applied, make them retrievable from the system.

Category: Business Computation