q Both specify the same information.
q Both explore the interaction among objects within a single problem domain.
q However, each emphasizes different aspects.
Figure 1: Sequence diagram
Figure 2: Collaboration diagram
q CRC Cards (Class-Responsibility-Collaboration Cards)
· A quick and simple alternative to Sequence and Collaboration diagram.
·
Usually 4 by 6 index cards that demonstrate the
behavior, characteristics, and purpose of a class.
Figure 3: CRC Card
|
|
|
·
Java,
COM, or CORBA interfaces are an example of Stereotypes. |
|
|
|
Object
Diagram (Figure 1)
·
With
the value of their attributes and their links.
·
E.g.:
Fred: Person.
Figure
1
Class Operations and Attributes
·
An
operation or attribute that is a property of the class is underlined.
|
|
Aggregation
and Composition (Figure 2)
|
|
q
Parts and wholes
· A looser coupling between the whole and the part via sharing of parts.
o
A
part may belong to only one whole.
§
E.g.: A car has an engine. |
|
Frozen
(Constraints) (Figure 2)
·
A Constraint {i.e.: Read only attribute}. ·
Constant cannot change. o
E.g.: A person’s SS# cannot change once set. ·
Association or association end cannot change. Derived Associations and Attributes (Figure
2)
Association
Class (Figure 2)
·
An
intermediate class among two or classes. o E.g.: A Person object might be
related to a Company object via an Employment Figure 2 Multiple and Dynamic Classification
· Refers to the relationship between an object and its type. · Single Classification: an object belongs to a single type. ·
Multiple Classification: an object may belong to many
types may or may ·
Dynamic Classification allows objects to change type
within an inheritance Miscellaneous
q
Abstract Class
·
Use Italic or the constraint {abstract}. ·
Interfaces in Java and Abstract Base Classes in C++. ·
Provides the important OOD concept of implementation
hiding. q
Reference Object
and Value Objects
Reference Object
·
Only one object is permitted. ·
To see if two object handles refer to the same
reference object, Value Objects
·
Multiple copies are allowed. ·
Compare their values. q
Specialization
(Classification) and Generalization
(Figure 3)
·
Beware! Class responsibilities can be confused. ·
Generalization is transitive. ·
Specialization is not. q "is-a"
·
"is-a-kind-of",
"is-a-type-of".
q Specialization ·
"is-an-instance-of".
q
Qualified Association (Figure 3) ·
UML’s ways to deal with concepts such as Maps,
Associative Arrays,
q
Parameterized
Class (Figure 4)
q
Visiblity (Figure 5) ·
Simply is the Encapsulation and Information Hiding concept in
OOP.
|
Package Diagram (Figure 1)
·
Package diagrams provide a mechanism for dividing and
grouping model elements (e.g., classes, use cases). In UML, a package is
represented as a folder.
Figure 1: Package Diagram
For a FREE UML Seminar on CD go to: http://www.rational.com/uml/index.jsp