Section 2.2.3.3 Domain Definitions


Provision of a domain for an attribute can be handled entirely through attribute - domain statements, defaults, and restricted clauses. Sometimes however, it is convenient to treat a character string domain as if it were an enumeration. For example assume a class definition includes as an attribute the name of a test carried out on some data. Also assume that the domain of the name attribute has been declared as string. In the definition of a subclass of that class, it may be of interest to restrict the possible values carried in the string to the names of the tests which might actually be run against the data. This can be done with a restricted clause, as previously described. Alternatively, a domain statement may be used which is analogous to an enumeration.

1 SupertypeThe supertype (i.e., superclass) is always Domain. Since Domain is part of the SAIF standard, the associated schema name is not specified.

2 domain nameThe name of the domain which is currently being defined is specified, including the name of the schema to which it belongs. The domain name should be meaningful, as with the names of classes and enumerations.

3 tagA SAIF profile or encoding scheme may require that each type have a unique tag, as discussed earlier. This applies to domain definitions as well as enumerations and classes.

4 base typeThe type of primitive included in the domain statement must be stated. This is usually string, but any kind of numeric may also be given.

5 valuesThe allowable values contained within the domain are listed. Test names for example may be given as: closureTest directionTest referenceTest. If the base type were numeric, allowable values might be: 1 2 4 6.

6 commentsComments concerning the domain and the particular meanings of the values may be provided.


Links to the SAIF 3.1 Specification document and the complete SAIF class list