Page 48 - DCAP308_OBJECT_ORIENTED_ANALYSIS_AND_DESIGN
P. 48
Object Oriented Analysis and Design
Notes
Figure 4.6: Structured Domains
During analysis you can ignore simple domains, but you should note enumerations and structured
domains. During design you should elaborate your object model by assigning a domain to each
attribute. During implementation you can then bind each domain to a data type and length.
Domains provide several benefits:
Consistent assignment of data types. You can help ensure that attributes have uniform
data types by first binding attributes to domains and then binding domains to data types.
Fewer decisions. Because domains standardize the choices of data type and length, there
are fewer implementation decisions.
Extensibility. It is easier to change data types when they are not directly assigned.
Check on validity of operations. Finally, you can use the semantic information in domains
to check the appropriateness of certain operations.
Example: It may not make sense to compare a name to an address.
Do not confuse a domain with a class. Figure 4.7 summarizes the differences between domains
and classes. The objects of a class have identity, may be described by attributes, and may have
rich operations. Classes may also be related by associations. In contrast, the values of a domain
lack identity.
Example: There can be many Jim Smith objects, but the value normal has only one
occurrence.
Most domain values have limited operations and are not described by attributes. During analysis
we distinguish between domains and classes according to their semantic intent, even though
some domains may be implemented as classes.
Figure 4.7 Classes and Domains differ According to Semantic Intent
Classes Domains
A class describes objects. A domain describes values.
• Objects have identity. • Values have no identity.
• Objects may be described by attributes. • Most values are not described by attributes.
• Objects may have rich operations. • Most values have limited operations.
• Classes may be related by associations. • Domains do not have associations.
Source: http://www.pearsonhighered.com/assets/hip/us/hip_us_pearsonhighered/samplechapter/
0131238299.pdf
42 LOVELY PROFESSIONAL UNIVERSITY