Professional Documents
Culture Documents
triangle : Polygon
underlined name
triangle : Polygon
center : Point = (2,2) triangle
vertices : Point* = ((0,0), (4, 0), (2,4))
borderColor : Color = black
fillColor : Color = white
: Polygon
attribute links
: Family
husband wife
Joe : Person Jill : Person
Triangle
foreach v in vertices do
+ move (in dist : Point) v.x := v.x + dist.x;
+ scale (in factor : Real) v.y := v.y + dist.y
foreach v in vertices do
v.x := factor * v.x;
v.y := factor * v.y
b
1.1.1: b
c
z
lifeline
stimulus
name (…)
delete
return create
Explicit asynchronous
flow of control
UML 1.4: Variant of async
Return
alarm
price dial digit
dial digit
lift receiver
iterate ()
get itinerary
present itinerary
select segment
update information
available flight
:
:
8: available flight
description of an / RoleName
«view of»
Instance.
A Classifier Role
defines a usage (an
abstraction) of an
Instance.
Classifier ClassifierRole
Attribute-1 Attribute-1
Attribute-2 Attribute-2
Attribute-3
«originates from» «conforms to»
Operation-1 (…)
Operation-1 (…) Operation-3 (…)
Operation-2 (…)
Operation-3 (…)
Instance
AttributeValue-1
AttributeValue-2
AttributeValue-3
/ ClassifierRoleName : ClassifierName
{frozen} 3..4
/ Role-1 / Role-2
Resulting multiplicity
Extra attribute
0..1 1 *
1 * * * *
: Faculty : Course Faculty Course
A Collaboration
and how its roles
CollaborationName
are mapped onto
a collection of
Classifiers and
Associations. roleName-1
roleName-2
roleName-3
Classifier-1 Classifier-2
Observer
Subject Handler
CallQueue SlidingBarIcon
Subject Handler
CallQueue Observer SlidingBarIcon
Subject Manager
ManagedQueue Supervisor Controller
: Faculty : Course
student
tutor Alice / Student
faculty member
John / Teacher
participant
faculty tutor Bob / Student
student
: Faculty participant
b
1.1.1: b
c
z
Constraining Element
(A Generalization is not
an AssociationRole )
Subject Handler
CallQueue Observer SlidingBarIcon
Subject Manager
ManagedQueue Supervisor Controller
/ Account / Itinerary
/ ARS Protocol
ON
ON ON
ON
OFF
Lamp On
on
off
off
Lamp Off
on/print(”on”) on
off off
off off
Lamp Lamp
Off Off
on/ctr := ctr + 1
off
off
Lamp Off
Ready
Transition
stop /ctr := 0
Done
Final
Action
state
stop
threshold
time
Terminate
Terminate
Object
Object
Wait
Waitfor
for Wait
Waitfor
for
Request
Request Request
Request
Handle
Handle Handle
Handle
Request
Request Request
Request
Terminate
Terminate Terminate
Terminate
Object
Object Object
Object
Initialize
Initialize
Object
Object
Wait
Waitfor
for
Request
Request
Handle
Handle
Request
Request
Terminate
Terminate
Object
Object
#currentEvent : Eventpoll/defer
created
+ start ( )
start start/^master.ready() ready
+ poll ( )
+ stop ( )
ready
stop/
poll/^master.ack()
ActiveObject:
Run-to-completion model:
•serialized event handling
•eliminates internal concurrency
•minimal context switching overhead
Active1
Active1 Active2
Active2
lo
hi
hi
LampOn
e2
entry/lamp.on();
exit/lamp.off();
e1
Internal transition
triggered by
an “off” event LampOff
entry/lamp.off();
exit/printf(“exiting”);
off/null;
“do” activity
Error
entry/printf(“error!”)
do/while (true) alarm.ring();
Unhappy
bid
Unhappy
1sec/
1sec/
on/ on/
FlashOff
LampOn
on/
entry/lamp.off()
entry/lamp.on()
off/ FlashOn
on/ on/
LampOn
on/ FlashOff
entry/lamp.on()
LampOff
flash/ LampFlashing
entry/lamp.off()
FlashOn
off/ entry/lamp.on()
1sec/
1sec/
on/
FlashOff
LampOn
on/
entry/lamp.off()
entry/lamp.on()
Group transition
Behavioral Modeling with UML 81
Completion Transitions
Triggered by a completion event
generated automatically when an
immediately nested state machine
terminates
completion
Committing transition (no trigger)
Phase1
Phase1
CommitDone
Phase2
Phase2
LampFlashing
FlashOn
on/
off/
on/
FlashOff
off/
on/
LampOn
entry/lamp.on()
initS2
S11 E/actE S21
exit/exS11 entry/enS21
Diagnosing
suspend/
Diagnostic1 Diagnostic2
Step11
Step11 Step21
Step21
resume/ Step12
Step12 Step22
Step22
H*
H*
Child
Poor
Adult
Rich
Retiree
Child
Poor
Adult
age financialStatus
Child Rich
Retiree
Poor
Adult
Retiree Rich
LawAbiding Poor
robBank/ robBank/
Outlaw Rich
Crazy Flying
entry/sane
entry/sane :=
:= false;
false; entry/flying
entry/flying :=
:= true;
true;
(flying)/ (sane)/
request
Grounding/ (~sane)/
Sane Grounded
entry/sane
entry/sane :=
:= true;
true; entry/flying
entry/flying :=
:= false;
false;
Child
Child Adult
Adult Retiree
Retiree
Staff
Staff Manager
Manager
Member
Member
employee
Person1 Person2
Child Child
Adult Adult
Retiree Retiree
AB SWITCH
receiver
End user line card N
ack
ackA
ack
data(2)
pktB
data(2)
ack
ackB
ack
…etc.
AcceptPktA RcvdPktA
ackB/^ack pktA/^data
data/^pktA ack/^ackA
timeout/^pktB timeout/^ackB
timeout/^pktA timeout/^ackA
ackA/^ack data/^pktB pktB/^data
ack/^ackB
AcceptPktB RcvdPktB
operator System
AB interface operator
receiver
AB lines
manager
AB
sender DB
interface
SWITCH
DBase
Hardware
JustCreated
Audit
Analysing
Failure
ReadyToGo
GettingData
AcceptPktA
Failed
WaitAckA WaitAckB
AcceptPktB
GettingData
Analysing
Failure
Hardware
Audit
ReadyToGo Failed
Operational
Behavioral Modeling with UML 100
Exploiting Inheritance
Abstract control classes can
capture the common control
behavior
AbstractController
Sender Receiver . . .
Analysing AbstractController
JustCreated
Failure
GettingData
Failed
Hardware
Audit
Sender
ReadyToGo
Operational
Analyze
AnalyzeWeather
WeatherInfo
Info
Not UML
Chart
ChartCourse Cancel
Notation! Course CancelTrip
Trip
Procure
Procure
Materials
Materials
Build Build
Build
Build
Subassembly Subassembly
Subassembly22
Subassembly11
Ready
ReadyFor
ForOrder
Order
Selection
Cancel Button
Made
Pressed
Dispense Return
Return
Dispense Change
Product
Product Change
Not UML
Notation
Behavioral Modeling with UML 110
Activity Diagrams Based on State
Machines
Action
Subactivity
Deliver Mail
POEmployee
POEmployee.sortMail POEmployee.deliverMail
POEmployee
PO Employee Deliver Mail Method
sortMail()
«realize»
deliverMail() Check Out Put Mail
Truck In Boxes
Action/Subactivity *
Applies to actions and subactivities.
Not inherited from state machines.
Invokes an action or subactivity any number of times in
parallel, as determined by an expression evaluated at
runtime. Expression also determines arguments.
Upper right-hand corner shows a multiplicity restricting
the number of parallel invocations.
Outgoing transition triggered when all invocations are
done.
Currently no standard notation for concurrency
expression or how arguments are accessed by actions.
Attach a note as workaround for expression. Issue for
UML 2.0. Behavioral Modeling with UML 117
Object Flow (State)
Class
[State]
Order
Take Order Fill Order
[Taken]
Initial state
Final state
Get
Authorization
Install
Inspect
Foundation *
*
Install Install
Install
Electricity Electricity
Electricity
in Foundation In Frame
Outside
Install Inspect
Foundation
Register Release
Bug Fix
Fix Test
Bug Fix
Register Release
[else]
Bug Fix
Fix Test
Bug Fix
semantics.
Tools can generate swimlane presentation
Support
Register Release
Bug Fix
Engineering
Fix Test
Bug Fix
Signal
Signal
Coffee Done
… translates to a wait
state (a state with no
action and a signal trigger Drink Coffee
event).
initial state
action state control flow
Begin
Case Study
fork of control
Develop
technology Issue RFP
specification
RFP
[issued]
conditional
fork join of control
Submit
specification
draft object flow
Specification
[optional] input value
[initial
proposal]
Collaborate with
competitive
Communications of the ACM
submitters
Evaluate initial
submissions
Kobryn, “UML 2001”
Finalize
October 1999
Adapted from
specification
Specification
[final
proposal]
Behavioral Modeling with UML 128
Collaborate with
competitive
submitters Evaluate initial
submissions
Finalize
specification
Specification
[final
proposal]
Evaluate final
submissions
Vote to
recommend
Study
guard
Revise
specification
Implement
specification
Communications of the ACM
Specification
[revised]
Enhance
Recommend
specification
revision
Kobryn, “UML 2001”
October 1999
Adapted from
[else] [Enhanced]
final state
Behavioral Modeling with UML 129
Diagrams
Use activity diagrams when the behavior you
are modeling ...
does not depend much on external events.
mostly has steps that run to completion, rather
than being interrupted by events.
requires object/data flow between steps.
is being constructed at a stage when you are
more concerned with which activities happen,
rather than which objects are responsible for
them (except partitions possibly).
Request
Return
Get Return
Number
Ship Item
Receive
Item
Item
[returned]
Restock
Item
Credit Item
Account [available]
Request
Return
Get Return
Number
Activity Modeling Tips
Ship Item
Receive
Item Item
[returned]
Restock
Item
Credit
Account Item
[available]
Well-nested:
Not well-nested: