Validation Rules

A validation rule identifies a set of values that an attribute is allowed to take. A validation rule constrains or restricts the domain of values that are acceptable. Values have meanings in both an abstract and a business sense. For example, if �person name,� is defined as the preferred form of address chosen by the PERSON, it is constrained to the set of all character strings. You can define any validation rules or valid values for an attribute as a part of the attribute definition. You can assign these validation rules to an attribute using a domain. Supported domains include text, number, datetime, and blob.

Definitions of attributes, such as codes, identifiers, or amounts, often are not good business examples. Including a description of the validation rules or valid values of the attribute is a good idea. When you define a validation rule, it is better to go beyond simply listing the values that an attribute can take. For example, you define the attribute �customer status� as follows:

Customer status: A code that describes the relationship between the CUSTOMER and our business. Valid values: A, P, F, N.

The validation rule specification is not helpful because it does not define what the codes mean. You can better describe the validation rule using a table or list of values, such as is described in the following table:

Valid value

Meaning

A: Active

The CUSTOMER is currently involved in a purchasing relationship with our company.

P: Prospect

Someone with whom we are interested in cultivating a relationship, but with whom we have no current purchasing relationship.

F: Former

The CUSTOMER relationship has lapsed. In other words, there has been no sale in the past 24 months.

N: No business accepted

The company has decided that no business relationships exist with this CUSTOMER.