Documente Academic
Documente Profesional
Documente Cultură
MODEL
initial
State name
action (params)
actions
entry/
exit/
s)
m
a
par
(
t
n
eve
do/
event (params)
actions
Unnamed states
final
a noteworthy occurrence
something that happens within the system or
interacting with the system at an instant
something that has a significant impact on the
system
examples
sending a signal or data
receiving a signal or data
making a request for execution
a Boolean condition becoming true
a timeout condition becoming true
Representation of events
events are represented by
unique labels in the diagram
sometimes the transitions that
are fired by the occurrence of
the event is also represented by
the same label
change event labels are
preceded by the keyword
when
Generating an Event
Transition
represents the change of states
of an object
switch from Joined University
to Registered for Fall
is an abstraction of an operation
registering for a course
has finite and significant duration
time taken to complete
Transition (continued)
may have parameters
a transition corresponding to the
registration process may have
course name and prerequisites
as parameters.
is triggered/invoked/fired by the
occurrence of an event
change of semester from
Summer to Fall may initiate the
registration process
Transition (continued)
Transition (continued)
is normally identified by the same label
as the event that fires the transition
register, withdraw,
may be associated with an action
diferent from actions associated with
the states
register may have an action to check
the validity of parameters, to check
that no previous registration has been
done for the same set of parameters
etc.
initial
clo
clo se/
se(
)
open/
open()
withdrawInitial /
withdraw()
deposit / deposit()
Overdraft
closeAC [amt=-balance] / deposit()
withdrawNormal [amt
< balance] /
withdraw()
Normal
withdrawOP /
withdraw()
Simple State
Simple State
CD drawer
closed
Power ON [no
CD]
CD drawer
open
Eject [no
CD]
Eject [CD in]
CD loaded
Power ON
[CD in]
Power OFF
Pause
CD
playing
CD
paused
Pause or Play
Stop
Play
CD
stopped
Eject
Stop
Power
OFF
Observations
The state diagram for the CD player
example indicates a composite state that
includes two MUTUALLY EXCLUSIVE states
The player will be in only one of these two
substates at any time, but not in both at
the same time
The guard condition on the initial state
chooses the appropriate substate upon
Power ON
There is only one terminal state that is
common to both the substates
No CD loaded
Eject
Power ON
[no CD]
Eject [CD in]
Power ON
[CD in]
CD loaded
Power
OFF
Concurrent
transition
Composite State
Project
Final exam
Lab
done
Lab 2
Lab
done
passed
Project
done
pass
fail
failed
Observations
Observations (continued)
if