The complete set of all possible values that an attribute can be assigned is called a domain. A domain is a set of validation criteria that can be applied to more than one attribute; it provides a means of standardizing the characteristics of the attributes. For example, the domain Date, which contains all possible valid dates, can be assigned to any of these attributes:

·          Employee Hire Date

·          Order Entry Date

·          Claim Submit Date

·          Course Start Date

An attribute must never contain values outside of its assigned domain. The domain values are defined by specifying the actual list of values or a set of rules. Employee Gender Code, for example, may be limited to the domain of female and male. Employee Hire Date may initially be assigned the rule that its domain contain only valid dates, for example. Therefore, this may include values such as:

·         February 15th, 2005

·         25 January 1910

·         20090410

·         March 10th, 2050

Because Employee Hire Date is limited to valid dates, it does not include February 30th, for example. We can restrict a domain with additional rules. For example, by restricting the Employee Hire Date domain to dates earlier than todays date, we would eliminate March 10th, 2050. By restricting Employee Hire Date to YYYYMMDD (that is, year, month, and day concatenated), we would eliminate all the examples given except for 20090410. Another way of refining this set of values is to restrict the domain of Employee Hire Date to dates that fall on a Monday, Tuesday, Wednesday, Thursday, or Friday (that is, the typical workweek).

There are three basic domain types:

·         Format. Format domains specify the standard types of data one can have in a database. For example, Integer, Character(30), and Date are all format domains.

·         List. List domains are similar to a drop-down list. They contain a finite set of values from which to choose. List domains are refinements of format domains. The format domain for Order Status Code might be Character(10). This domain can be further defined through a list domain of possible values {Open, Shipped, Closed, Returned}.

·         Range. Range domains allow all values that are between a minimum and maximum value. For example, Order Delivery Date must be between todays date and three months in the future. As with list domains, range domains are a refined version of a format domain.

Domains are very useful for a number of reasons:

·         Improves data quality by checking against a domain before inserting data. This is the primary reason for having a domain. By limiting the possible values of an attribute, the chances of bad data getting into the database are reduced. For example, if every attribute that represents money is assigned the Amount domain, consisting of all decimal numbers up to 15 digits in length including two digits after the decimal point, then there is a good chance that each of these attributes actually do contain currency. Gross Sales Amount, which is assigned the amount domain, would not allow the value R2D2 to be added.

·         The data model communicates even more. When we display domains on a data model, the data model communicates that a particular attribute has the properties of a particular domain, so the data model becomes a more comprehensive communication tool. We learn, for example, that Gross Sales Amount, Net Sales Value Amount, and List Price Amount all share the Amount domain and, therefore, share properties such that their valid values are limited to currency.

·         Greater efficiency in building new models and maintaining existing models. When a data modeler embarks on a project, she can use a standard set of domains, thereby saving time by not reinventing the wheel. Any new attribute that ends in Amount, for example, would be associated with the standard Amount domain, saving analysis and design time.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset