Statechart Diagrams - PowerPoint PPT Presentation

1 / 19
About This Presentation
Title:

Statechart Diagrams

Description:

One of the diagrams in the UML for modeling the dynamic aspects of systems. For the most part, this involves modeling the behavior of reactive objects ... – PowerPoint PPT presentation

Number of Views:1631
Avg rating:3.0/5.0
Slides: 20
Provided by: terryqu
Category:

less

Transcript and Presenter's Notes

Title: Statechart Diagrams


1
Statechart Diagrams
  • Keng Siau
  • University of Nebraska-Lincoln

2
Statechart Diagrams
  • A statechart diagram shows a state machine
  • One of the diagrams in the UML for modeling the
    dynamic aspects of systems
  • For the most part, this involves modeling the
    behavior of reactive objects
  • A reactive object is one whose behavior is best
    characterized by its response to events
    dispatched from outside its context

3
Activity and Statechart Diagrams
  • An activity diagram is a special case of a
    statechart diagram in which all or most of the
    states are activity states and all or most of the
    transitions are triggered by completion of
    activities in the source state

4
Activity and Statechart Diagrams
  • An activity diagram shows flow of control from
    activity to activity
  • A statechart diagram shows flow of control from
    state to state
  • Statechart diagrams may be attached to classes,
    use cases, or entire systems in order to
    visualize, specify, construct, and document the
    dynamics of an individual object

5
Terms and Concepts
  • A statechart diagram shows a state machine,
    emphasizing the flow of control from state to
    state
  • A state machine is a behavior that specifies the
    sequences of states an object goes through during
    its lifetime in response to events, together with
    its responses to those events

6
Terms and Concepts
  • The state of an object is a condition or
    situation during the life of an object during
    which it satisfies some condition, performs some
    activity, or waits for some event
  • An event is the specification of a significant
    occurrence that has a location in time and space

7
Terms and Concepts
  • A transition is a relationship between two states
    indicating that an object in the first state will
    perform certain actions and enter the second
    state when a specified event occurs and specified
    conditions are satisfied

8
Terms and Concepts
  • An activity is an ongoing nonatomic execution
    within a state machine
  • An action is an executable atomic computations
    that result in a change in state of the model or
    a return of a value

9
Statechart Diagrams
  • Graphically, a statechart diagram is a collection
    of vertices and arcs
  • Statechart diagrams commonly contain
  • Simple states and composite states
  • Transitions, including events and actions

10
Statechart Notation
11
Statechart Diagram
Add student count lt 10
Add Student /
Set count 0
Initialization
Open
do Initialize course
entry Register student
exit Increment count
Cancel
Cancel
count 10
Canceled
Closed
do Notify registered students
Cancel
do Finalize course
12
Statechart Diagram
13
Statechart Diagram
14
Statechart Diagram
15
Statechart Diagram
16
Statechart Diagram
17
Statechart Diagram
18
Statechart Diagram
19
Modeling Reactive Objects
  • The most common purpose of statechart diagrams is
    to model the behavior of reactive objects
  • Specify three things
  • The stable states in which that object may live
  • The events that trigger a transition from state
    to state
  • The actions that occur on each state change
Write a Comment
User Comments (0)
About PowerShow.com