Page 46 - DCAP308_OBJECT_ORIENTED_ANALYSIS_AND_DESIGN
P. 46
Object Oriented Analysis and Design
Notes
Figure 4.2: Instead of using Class Attributes, Model Groups Explicitly
4.1.3 Attribute Multiplicity
Attribute multiplicity specifies the possible number of values for an attribute and is listed in
brackets after the attribute name. You may specify a mandatory single value [1], an optional
single value [0..1], an unbounded collection with a lower limit [lowerLimit..*], or a collection
with xed limits [lower limit..upper limit]. A lower limit of zero allows null values; a lower limit
of one or more forbids null values.
If you omit attribute multiplicity, an attribute is assumed to be single valued with nullability
unspecified ([0..1] or [1]). In Figure 4.3 a person has one name, one or more addresses, zero or
more phone numbers, and one birth date. Attribute multiplicity is similar to multiplicity for
associations.
Figure 4.3: Attribute Multiplicity
Did u know? Null is a special value denoting that an attribute value is unknown or not
applicable.
4.1.4 Candidate Keys for Classes
A candidate key for a class is a combination of one or more attributes that uniquely identifies
objects within a class. The collection of attributes in a candidate key must be minimal; no
attribute can be discarded from the candidate key without destroying uniqueness. No attribute
in a candidate key can be null. A given attribute may participate in multiple candidate keys.
40 LOVELY PROFESSIONAL UNIVERSITY