Where Are We?
What Are Class Diagrams?
What Are Class Diagrams?
What Are Class Diagrams?
What Are Class Diagrams?
Where Are We?
Review

Диаграммы классов в Rose. (Тема 7)

1.

Тема 7: Диаграммы классов

2. Where Are We?

What are class diagrams?
Elements of the class diagram
Fundamentals of Rational Rose
Copyright © 2000, 2002 Rational Software, all rights reserved
2

3. What Are Class Diagrams?

A class diagram shows a set of classes,
interfaces, and their relationships.
Fundamentals of Rational Rose
Copyright © 2000, 2002 Rational Software, all rights reserved
3

4. What Are Class Diagrams?

You will use input artifacts, including the
interaction diagrams, to develop and refine
the class diagram.
Supplementary
Specifications
Class Diagram
Design
Guidelines
Interaction Diagrams
Fundamentals of Rational Rose
Copyright © 2000, 2002 Rational Software, all rights reserved
4

5. What Are Class Diagrams?

Class diagrams show the static view of the
system and are modeled in the Logical View
under the appropriate use-case realization.
Fundamentals of Rational Rose
Copyright © 2000, 2002 Rational Software, all rights reserved
5

6. What Are Class Diagrams?

A VOPC class diagram shows a use-case
realization’s participating classes and the
relationships among those classes.
It shows all classes whose instances
collaborate to perform the use case and
their relationships.
It ensures consistency in use-case
implementation across subsystem
boundaries.
Fundamentals of Rational Rose
Copyright © 2000, 2002 Rational Software, all rights reserved
6

7. Where Are We?

What are class diagrams?
Elements of the class diagram
Fundamentals of Rational Rose
Copyright © 2000, 2002 Rational Software, all rights reserved
7

8.

Elements of a Class Diagram
A class diagram is made up of the following
basic elements
Classes
Relationships
• Associations
• Aggregations
• Generalizations
Fundamentals of Rational Rose
Copyright © 2000, 2002 Rational Software, all rights reserved
8

9.

Classes
A class is a set of objects that share the
same attributes, operations, relationships,
and semantics.
In the UML, a class is represented by a
compartmentalized rectangle.
Fundamentals of Rational Rose
Copyright © 2000, 2002 Rational Software, all rights reserved
9

10.

Relationships
A relationship is a semantic connection
among elements.
A class diagram has three types of
relationships
Associations
Aggregate Associations
Generalizations
Fundamentals of Rational Rose
Copyright © 2000, 2002 Rational Software, all rights reserved
10

11.

Associations
An association is the most general
relationship and indicates communication
only.
In the UML, an association is represented
by a solid line with or without an arrow.
Association Relationships
Fundamentals of Rational Rose
Copyright © 2000, 2002 Rational Software, all rights reserved
11

12.

Aggregate Associations
An aggregate association is a type of
association where a whole is related to its
part(s).
In the UML, an aggregation is represented
by a solid line with or without an arrow on
one end and hollow diamond at the end of
the aggregate (whole).
Aggregate Relationships
Fundamentals of Rational Rose
Copyright © 2000, 2002 Rational Software, all rights reserved
12

13.

Association Specifiers
Associations in a class diagram can be
further defined by
Association Names
Role Names
Multiplicity
Fundamentals of Rational Rose
Copyright © 2000, 2002 Rational Software, all rights reserved
13

14.

Association Names
An association name is a label that clarifies
the meaning of the association.
In Rose, the association name is placed
along the middle of the association line.
Association Name
Fundamentals of Rational Rose
Copyright © 2000, 2002 Rational Software, all rights reserved
14

15.

Role Names
A role name is a label that specifies the
“face” the class plays in an association.
In Rose, the role name is placed along the
association line nearest the class it
modifies.
Role Name
Fundamentals of Rational Rose
Copyright © 2000, 2002 Rational Software, all rights reserved
15

16.

Multiplicity
Multiplicity is the number of instances a
class relates to an instance of another
class.
Multiplicity is defined at both ends of the
association line.
Multiplicity
Fundamentals of Rational Rose
Copyright © 2000, 2002 Rational Software, all rights reserved
16

17.

Generalizations
A generalization is a parent/child
relationship where one class shares
the structure and behavior of one or more
classes.
In the UML, a generalization relationship is
represented by a solid line with a hollow
arrow.
Generalization Relationship
Fundamentals of Rational Rose
Copyright © 2000, 2002 Rational Software, all rights reserved
17

18. Review

1.
2.
3.
4.
5.
Define a class diagram.
What is a VOPC class diagram?
Name two elements of a class diagram.
What is an aggregate association?
When should you use role
names?
6. What is multiplicity?
7. What is a generalization?
Fundamentals of Rational Rose
Copyright © 2000, 2002 Rational Software, all rights reserved
18
English     Русский Правила