Art for Chapter 2, Modeling with UML - PowerPoint PPT Presentation

1 / 49
About This Presentation
Title:

Art for Chapter 2, Modeling with UML

Description:

Blinking. Figure 2-4, A UML statechart diagram for SetTime use case of the SimpleWatch. ... entry/blink hours. exit/stop blinking. pressButton1/blink next number ... – PowerPoint PPT presentation

Number of Views:18
Avg rating:3.0/5.0
Slides: 50
Provided by: bernd181
Category:
Tags: uml | art | blink | chapter | modeling

less

Transcript and Presenter's Notes

Title: Art for Chapter 2, Modeling with UML


1
Art for Chapter 2,Modeling with UML
2
Figure 2-1, A UML use case diagram describing the
functionality of a simple watch.
3
Figure 2-2, A UML class diagram describing the
elements of a simple watch.
4
Figure 2-3, A UML sequence diagram for the
SimpleWatch.
5
Figure 2-4, A UML statechart diagram for SetTime
use case of the SimpleWatch.
button2Pressed
button12Pressed
Blink
Hours
button1Pressed
button2Pressed
button12Pressed
Blink
Minutes
button1Pressed
button2Pressed
Blink
Stop
Seconds
Blinking
6
Figure 2-5, An example of a UML activity diagram.
7
Figure 2-6, A Model is an abstraction describing
a subset of a System. A View depicts selected
aspects of a Model. Views and Models of a single
System may overlap each other.
Scale model
Electrical
All blueprints
Airplane
Fuel
Flight simulator
8
Figure 2-7, Example of describing a model with
different notations. 1 means 1..1, means
0..
RJL UML head/tail (either can mean 0 ..)
Book
1..1
0..
Chapter
1..1
0..
Book
Chapter
9
Figure 2-8, A UML class diagram depicting two
classes Watch and CalculatorWatch.
CalculatorWatch is a refinement of Watch,
providing calculator functionality normally not
found in normal Watches.
Watch
time
date
SetDate(d)
CalculatorWatch
calculatorState
10
Figure 2-8a Same UML class diagram depicting two
classes Subclass(es) are linked vertically below
a bar which has link up to superclass. (Multiple
refinements may be mutually exclusive or
overlapping, exhaustive or incomplete. One bar
is shown for each superclass if there is multiple
inheritance.)
Watch
time
date
SetDate(d)
CalculatorWatch
calculatorState
11
Figure 2-9, An example of abstract class
(in italics)
OrganicCompound
Benzene
12
Figure 2-10, A UML class diagram depicting
instances of two classes.
instanceOf
Watch
simpleWatch1291Watch
instanceOf
calculatorWatch1515
CalculatorWatch
CalculatorWatch
Also called an Object Diagram - RJLI.e,
object ltltisInstanceOfgtgt its class. Compare to
is_asubclassOf (open triangle) Compare to
isPartOf (open or filled diamond).
13
Figure 2-11, Examples of message sends.
(Objects interact horizontally.)
WatchUser
pressButton2()
getTime()
GMTTime
getTimeDelta()
GMTTime
(time advances downward)
14
Figure 2-12, The application domain model
represents entities of the environment which are
relevant to an air traffic control system (e.g.,
aircraft, traffic controllers).
Application Domain
Solution Domain
Application Domain Model
System Model
MapDisplay
TrafficControl
SummaryDisplay
FlightPlanDatabase
TrafficController
Aircraft
Airport
TrafficControl
FlightPlan
15
Figure 2-13, An example of a UML use case
diagram Incident initiation in an accident
management system.
FRIEND
Report

Emergency
OpenIncident
FieldOfficer
Dispatcher
AllocateResources
16
Figure 2-16, An example of an include
relationship.
include
OpenIncident
HelpDispatcher
include
AllocateResources
17
Figure 2-18, An example of an extend
relationship.
18
Figure 2-20, An example of a generalization
relationship.
Authenticate
WithPassword
Authenticate
Authenticate
WithCard
19
Figure 2-22, An example of a UML class diagram
classes that participate in the ReportEmergency
use case.
reports
1
Incident
EmergencyReport
1..

reportsGenerated

incidentsGenerated
Dispatcher
FieldOfficer
1
1
nameString
nameString
badgeNumberInteger
badgeNumberInteger
initiator
author
20
Figure 2-22a, Same UML class diagram example
redrawn with super- or aggregate classes above or
to left of sub- or component classes.
Dispatcher
FieldOfficer
nameString
nameString
badgeNumberInteger
badgeNumberInteger
initiator
1
author
1
reportsGenerated

incidentsGenerated

reports
EmergencyReport
Incident
1
1..
21
Figure 2-23, An example of a UML object diagram
objects that participate in the warehouseOnFire
scenario.
report_1291
incident_1515
bobFieldOfficer
name Bob D.
badgeNumber 132
johnDispatcher
name John D.
aliceFieldOfficer
badgeNumber 12
name Alice W.
badgeNumber 23
22
Figure 2-24, Example of a one-directional
association.


Polygon
Point
Here, I would prefer that UML had put the
arrowhead or direction indicator near the middle
of a link which is traversable in one direction
only. RJL
23
Figure 2-25, An example of an association class.
Allocates
roleString
notificationTimeTime
FieldOfficer
Incident
nameString
1
resources
badgeNumberInteger
incident
1..
24
Figure 2-26, Alternative model for Allocation, as
an Associative Entity.
Allocation
1
1
roleString
notificationTimeTime
incident
1
Incident
resources
1..
FieldOfficer
nameString
badgeNumberInteger
This is an uncommon example of an Association
class - RJL. (All FieldOfficer resources must be
allocated at the same time (and have the same
Role)! every FieldOfficer MUST BE Allocated to
an Incident. ) See the next slide, which is not
a compatible generalization of this one.)
25
Figure 2-26a, Alternative model for Allocation.
FieldOfficers may be allocated to multiple
incidents concurrently. Each Allocation instance
relates one FieldOfficer to one
incident notificationTime is unique to one
FieldOfficer, Incident pair Some FieldOfficers
may be uncommitted. (See pp 53-54)
FieldOfficer
nameString
Incident
badgeNumberInteger
incident
1
resource
1
0..
1..
Allocation
1
roleString
notificationTimeTime
26
Figure 2-27, Examples of aggregations.(Hollow
diamonds in UML indicate sharable items, not
private components, therefore not
cascade-deletable.)
27
Figure 2-28, Examples of multiplicity.
Author or co-author
28
Figure 2-29, Example of a hierarchical file
system. A recursive implementation of a
tree-structure.
29
Figure 2-30, Example of a nonhierarchical file
system. Directory to FileSystemElement is
many-to-many,so multiple directories can share
the same file object there could be an
attributed binary associative entity inbetween.
- RJL
Exercise What does attributed mean? How would
you add the Unix symbolic link as a third
subclass to this model? (See Bachman File
Structure models, CACM )
30
Figure 2-31, Example of how a qualified
association use reduces multiplicity.
Deprecated by me RJL
Without qualification
1

filename
With qualification
0..1
1
31
Figure 2-32, An example of a generalization.
32
Figure 2-33, Examples of operations provided by
the Incident class.
33
Figure 2-34, Example of a sequence diagram
setting the time on 2Bwatch. (Same as
SimpleWatch, Fig. 2-3)
34
Figure 2-35, Examples of conditions and iterators
in sequence diagrams.
a
b
c
igt0 op1()
ilt0 op2()
op3()
35
Figure 2-36, Example of a collaboration diagram
Setting the time on 2Bwatch.
2BwatchOwner
1p
ressButtons1And2()
2pressButton1()
3pressButton2()
1.1
blinkHours()
4pressButtons1And2()
2.1blinkMinutes()
4.2stopBlinking()
2BwatchInput
2BwatchDisplay
3.1i
ncrementMinutes()
4.1c
ommitNewTime()
3.2r
efresh()
2BwatchTime
36
Figure 2-37, A UML statechart diagram for the
Incident class.
Active
Inactive
Closed
Archived
incidentHandled
incidentDocumented
incidentArchived
37
Figure 2-38, Statechart diagram for 2Bwatch set
time function.
38
Figure 2-39, Internal transitions associated with
the SetTime state.
39
Figure 2-40, Refined statechart associated with
the SetTime state.
SetTime
b1
b1
BlinkHours
BlinkMinutes
BlinkSeconds
b2/incr sec.
b2/incr hour
b2/incr min.
b1
b1
BlinkYear
BlinkMonth
BlinkDay
b2/incr year
b2/incr mo.
b2/incr day
b1
b1
40
Figure 2-41, A UML activity diagram for Incident.
41
Figure 2-42, Example of decision in the
OpenIncident process.
42
Figure 2-43, An example of complex transitions in
a UML activity diagram.
43
Figure 2-44, An example of swimlanes in a UML
activity diagram.
Dispatcher
FieldOfficer
44
Figure 2-45, Example of packages use cases of
FRIEND organized by actors.
45
Figure 2-46, Example of packages.
46
Figure 2-47, Example of packages.
47
Figure 2-48, An example of a note. Notes can be
attached to a specific element in a diagram.
DispatcherStation
FieldStation
Dispatcher
FieldOfficer
The Emer
gencyReport
class is defined in FieldStation
and used in both stations.
EmergencyReport
Incident
48
Figure 2-49, Examples of stereotypes.
entity
boundary
control
Year
ChangeDateControl
ButtonBoundary
entity
boundary
entity
Month
LCDDisplayBoundary
Day
49
Figure 2-50, An example of constraint.
reports
1
EmergencyReport
Incident
1..
ordered by time of receipt
Write a Comment
User Comments (0)
About PowerShow.com