Академический Документы
Профессиональный Документы
Культура Документы
An Introduction to
Object-Oriented
Systems Analysis and Design
with UML and
the Unified Process
McGraw-Hill, 2004
Stephen R. Schach
srs@vuse.vanderbilt.edu
Copyright 2004 by The McGraw-Hill Companies, Inc. All rights reserved.
CHAPTER 10 Unit A
MORE ON UML
Slide 10A.2
Chapter Overview
Slide 10A.3
Deployment Diagrams
Review of UML Diagrams
UML and Iteration
Slide 10A.4
Slide 10A.5
Slide 10A.6
Slide 10A.7
Slide 10A.8
UML is a language
Slide 10A.9
Slide 10A.10
Class Diagrams
Slide 10A.11
Slide 10A.12
Example:
Slide 10A.13
Slide 10A.14
Slide 10A.15
means
an instance of class Bank Account Class
Slide 10A.16
Slide 10A.17
Example:
Class diagram with visibility prefixes added
Aggregation
Slide 10A.18
Aggregation (contd)
Slide 10A.19
Multiplicity
Slide 10A.20
Multiplicity (contd)
Slide 10A.21
Multiplicity (contd)
Slide 10A.22
Item 1:
The line connecting Chassis Class to Car Class
The 1 at the part end of the line denotes that there is one chassis
involved
The 1 at the whole end denotes that there is one car involved
Multiplicity (contd)
Slide 10A.23
Item 2:
The line connecting Wheels Class to Car Class
The 4..5 at the part end together with the 1 at the whole end
denotes that each car has from 4 to 5 wheels (the fifth wheel is the
spare)
Multiplicity (contd)
Slide 10A.24
Item 3:
The line connecting Sun Roof Class to Car Class
Two dots .. denote a range, so the 0..1 means zero or one, the
UML way of denoting optional
Multiplicity (contd)
Slide 10A.25
Item 4:
The line connecting Fuzzy Dice Class to Car Class
The * by itself means zero or more
Each car has zero or more fuzzy dice hanging from the
rear-view mirror, as required
Multiplicity (contd)
Slide 10A.26
Item 5:
The line connecting Seats Class to Car Class
An asterisk in a range denotes or more, so the 2..* means 2 or
more
Multiplicity (contd)
Slide 10A.27
Composition
Slide 10A.28
Composition (contd)
Slide 10A.29
Association
Models the partwhole relationship
Composition
Also models the partwhole relationship
In addition, every part may belong to only one whole
If the whole is deleted, so are the parts
Composition (contd)
Slide 10A.30
Inheritance
Slide 10A.31
Generalization
Slide 10A.32
Association
Example of association:
Slide 10A.33
Association (contd)
Slide 10A.34
Association (contd)
Slide 10A.35
Notes
A comment in a
UML diagram is
called a note
A rectangle
with the top
right-hand
corner bent
over
A dashed line
is drawn from
the note to the
item to which
the note refers
Copyright 2004 by The McGraw-Hill Companies, Inc. All rights reserved.
Slide 10A.36
Use-Case Diagrams
Slide 10A.37
Slide 10A.38
Stereotypes
Slide 10A.39
Stereotypes (contd)
Slide 10A.40
Stereotypes (contd)
Slide 10A.41
Interaction Diagrams
Slide 10A.42
Sequence Diagrams
Example:
Dynamic
creation
followed by
destruction of
an object
Slide 10A.43
Slide 10A.44
Slide 10A.45
Slide 10A.46
Slide 10A.47
Slide 10A.48
Slide 10A.49
Example:
Collaboration Diagrams
Slide 10A.50
Statecharts
Slide 10A.51
Statecharts (contd)
Slide 10A.52
Statecharts (contd)
Slide 10A.53
Statecharts (contd)
Slide 10A.54
is performed
Statecharts (contd)
Slide 10A.55
If
event
is performed
Statecharts (contd)
Slide 10A.56
Statecharts (contd)
The guard
[a message has been received]
Slide 10A.57
Statecharts (contd)
As part of a transition
Action
Slide 10A.58
Statecharts (contd)
Slide 10A.59
Example:
When (cost > 1000) or after (2.5 seconds)
Statecharts (contd)
Superstates
combine
related states
Slide 10A.60
Statecharts (contd)
Slide 10A.61
Statecharts (contd)
Slide 10A.62
Activity Diagrams
Slide 10A.63
Example:
One diner orders chicken, the other fish
The waiter writes down their order, and hands it to the
chef
The meal is served only when both dishes have been
prepared
Example:
Slide 10A.64
Slide 10A.65
A fork has
One incoming transition, and
Many outgoing transitions, each of which starts an activity
to be executed in parallel with the other activities
A join has
Many incoming transitions, each of which lead from an
activity executed in parallel with the other activities, and
One outgoing transition that is started when all the parallel
activities have been completed
Example: A
company that
assembles
computers as
specified by the
customer
Slide 10A.66
Slide 10A.67
Packages
Slide 10A.68
Packages (contd)
Slide 10A.69
Component Diagrams
Slide 10A.70
Slide 10A.71
Example:
Programmers write source code in an object-oriented
language
C++ or Java
The compiled code for each module is combined with runtime routines to produce an executable load image (that is,
a program)
Example:
Slide 10A.72
Deployment Diagrams
Slide 10A.73
Example:
Slide 10A.74
Slide 10A.75
Slide 10A.76
A statechart shows
States (specific values of attributes of objects)
Events that cause transitions between states (subject to
guards), and
Actions taken by objects
Slide 10A.77