Understanding the Notation: Defining and Using Domains

Sybase's PowerDesigner 9.0, which I used to model Figure 1, makes it easy for you to define and use domains. In database terminology, domain refers to a description of an attribute's allowed values. That description is divided into two levels: the physical description, which is the set of allowed data values for the attribute, and the logical description, which is the meaning of the attribute itself. Domains in the PowerDesigner 9.0 conceptual data model are logical domains. The PowerDesigner 9.0 interface lets you define domains that you can then use in place of regular data types. You treat these domains like any other database object; they have properties such as data type and length, checks (default, minimum, maximum, listed values), rules, and dependencies. Using domains in lieu of regular data types is useful when you want to maintain consistency of data types throughout a database. I used three different domains in this article: IDENTITY, NAME, and US_PHONE_NBR, which you can see in Figure 1. IDENTITY is a long integer data type, NAME is a variable-character data type of length 20, and US_PHONE_NBR is a variable-character data type of length 12. Domains are limited to the data modeling software because SQL Server 2000 doesn't support them, but the code that implements the design also converts the domains to SQL Server data types. For example, the IDENTITY domain becomes a data type with the SQL Server IDENTITY property.

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish