State Machine Diagrams

Slides:



Advertisements
Similar presentations
State Charts Mehran Najafi. Reactive Systems A reactive, event-driven, object is one whose behavior is best characterized by its response to events dispatched.
Advertisements

Nested state diagrams:Problems with flat state diagram
Concepts & Notations. Acknowledgements  The material in this tutorial is based in part on: Concurrency: State Models & Java Programming, by Jeff Magee.
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
UML State chart/machine diagram State machine diagram is a behavior diagram which shows discrete behavior of a part of designed system through finite state.
® IBM Software Group © 2006 IBM Corporation Rational Software France Object-Oriented Analysis and Design with UML2 and Rational Software Modeler 04. Other.
Activity Diagrams [Arlow and Neustadt, 2005] CS 425 / 625 Seminar on Software Engineering University of Nevada, Reno Department of Computer Science & Engineering.
UML Activity Diagrams In UML an activity diagram is used to display the sequence of actions They show the workflow from start to finish Detail the many.
1 CS/CPE 426 Senior Projects Chapter 21: State Machines Chapter 22:Advanced State Machines [Arlow and Neustadt 2005] March 24, 2009.
C++ Training Datascope Lawrence D’Antonio Lecture 11 UML.
THE OBJECT-ORIENTED DESIGN WORKFLOW Statechart Diagrams.
State Change Modelling. Aim: To introduce the concept and techniques for describing the changes in state that may occur to an object in its lifetime.
Advanced Behavioral Modeling
SE-565 Software System Requirements More UML Diagrams.
UML Class Diagrams: Basic Concepts. Objects –The purpose of class modeling is to describe objects. –An object is a concept, abstraction or thing that.
Software Engineering EKT 420. What is Activity Diagram Activity diagrams are graphical representations of workflows of stepwise activities and actions.
State and Sequence Diagrams Modelling dynamic information So far we have seen: Use Case Diagrams – requirements capture, interface.
Lecture 4 Finite State Machine CS6133 Software Specification and Verification.
Chapter 10 State Machine Diagrams
1 Object-Oriented Modeling Using UML (2) CS 3331 Fall 2009.
Business Informatics Group Institute of Software Technology and Interactive Systems Vienna University of Technology Favoritenstraße 9-11/188-3, 1040 Vienna,
Guide to State Transition Diagram. 2 Contents  What is state transition diagram?  When is state transition diagram used?  What are state transition.
Object-Oriented Modeling Using UML CS 3331 Section 2.3 of Jia 2003.
1 Devon M. Simmonds University of North Carolina, Wilmington CSC450 Software Engineering WorkFlow Modeling with Activity Diagrams.
Session 22 Modeling the Extended Features of the Statechart Written by Thomas A. Pender Published by Wiley Publishing, Inc. October 27, 2011 Presented.
Activity diagrams. Introduction ● Activity diagrams are a behavioural model that represent the dynamics of the system. ● An activity diagram is essentially.
7 Systems Analysis and Design in a Changing World, Fifth Edition.
Course Instructor: Kashif Ihsan 1. Chapter # 3 2.
Information System Design IT60105
Software Engineering Design & Modeling Statechart Diagram.
UML Discussion on State Machines Perfectly static system is intensely uninteresting Because nothing ever happens.
Chapter 11 Activity Diagrams. 2 “Activity diagrams are a technique to describe procedural logic, business processes, and work flows” - M. Fowler An activity.
Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 UML State Diagrams.
States.
CS3773 Software Engineering Lecture 06 UML State Machines.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 26. Review UML behavioral Diagrams – Sequence diagram.
Chapter 14: Activity Diagrams November 2015 [Arlow and Neustadt, 2005] CS 425/625 Senior Projects University of Nevada, Reno Department of Computer Science.
Chapter 3: Introducing the UML
Modeling Object Lifecycles and State-Dependent Behavior ©SoftMoore ConsultingSlide 1.
 Activity diagram is basically a flow chart to represent the flow from one activity to another activity.
State Modeling. Introduction A state model describes the sequences of operations that occur in response to external stimuli. As opposed to what the operations.
® IBM Software Group © 2009 IBM Corporation Module 11: Creating State Machine Diagrams Essentials of Modeling with IBM Rational Software Architect V7.5.
1 Object Oriented Analysis System modeling = Functional modeling + Object modeling + Dynamic modeling Functional modeling = Use cases Object modeling =class.
UML Review: State Machines. Sept. 17, 2003Lecture 5: CS660 Fall Overview States Transitions Activities Modeling object lifeline Creating well-structured.
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 Advanced UML State Diagrams.
State transition modeling
UML Chapter 17.
State Machine Diagram.
State Machine Diagrams
Activity and State Transition Diagram
UML Class Diagrams: Basic Concepts
UML Activity Diagrams & State Charts
UML State machine diagram
States.
Object Oriented System Design
CS/CPE 426 Senior Projects
SS 2018 Software Verification ML, state machines
Chapter 14: Activity Diagrams
Activity Diagrams.
CIS 375 Bruce R. Maxim UM-Dearborn
Chapter 5 state Modeling
CS/CPE 426 Senior Projects
States.
Chapter 14: Activity Diagrams
CS 791Z State Machines & Advanced State Machines
CIS 375 Bruce R. Maxim UM-Dearborn
UML State Diagrams.
Behavioral Diagrams P. P. Mahale
UNIT 3 UNIT 3 DYNAMIC MODELING Coming up: Interaction Diagrams.
Presentation transcript:

State Machine Diagrams

State Machine Diagrams State machine diagram is a behavior diagram which shows discrete behavior of a part of designed system through finite state transitions. State machine diagrams can also be used to express the usage protocol of part of a system. A statechart diagram shows the lifecycle of an object: what events it experiences, its transitions, and the states it is in between these events.

State Machine Diagrams Subject of a Statechart Diagram- A statechart diagram may be applied to a variety of UML elements, including: • classes (conceptual or software) • use cases

State Machine Diagrams The following nodes and edges are typically drawn in state machine diagram: behavioral state,  behavioral transition, protocol state, protocol transition, different pseudostates.

Types of State Machine Diagrams Behavioral State Machine Protocol State Machine

Behavioral State Machine Behavioral state machine is specialization of behavior and is used to specify discrete behavior of a part of designed system through finite state transitions. Behavior is modeled as a traversal of a graph of state nodes connected with transitions.

State Machine Diagram

Vertex Vertex is named element which is an abstraction of a node in a state machine graph. In general, it can be the source or destination of any number of transitions. Subclasses of vertex are: state pseudostate State is a vertex which models a situation during which some (usually implicit) invariant condition holds.

Behavioral State State in behavioral state machines models a situation during which some (usually implicit) invariant condition holds. The invariant may represent a static situation such as an object waiting for some external event to occur. However, it can also model dynamic conditions such as the process of performing some behavior (i.e., the model element under consideration enters the state when the behavior commences and leaves it as soon as the behavior is completed).

The UML defines the following kinds of states: simple state, composite state, submachine state.

Simple State A simple state is a state that does not have substates - it has no regions and it has no submachine states. Simple state is shown as a rectangle with rounded corners and the state name inside the rectangle.

Simple state may have compartments. The compartments of the state are: name compartment internal activities compartment internal transitions compartment

Composite State Generally, composite state is defined as state that has substates (nested states). Substates could be sequential (disjoint) or concurrent (orthogonal). UML defines composite state as the state which contains one or more regions. (Note, that region is defined back as an orthogonal part of either a composite state or a state machine.) A state is not allowed to have both regions and a submachine. Simple composite state contains just one region.

Pseudostate Pseudostates include: initial pseudostate terminate pseudostate entry point exit point choice join fork junction

Initial Pseudostate-An initial pseudostate represents a default vertex that is the source for a single transition to the default state of a composite state

Terminate Pseudostate- Terminate pseudostate implies that the execution of this state machine by means of its context object is terminated.

Entry point pseudostate is an entry point of a state machine or composite state. In each region of the state machine or composite state it has at most a single transition to a vertex within the same region. Exit point pseudostate is an exit point of a state machine or composite state. Entering an exit implies the exit of this composite state or submachine state and the triggering of the transition that has this exit point as source in the state machine enclosing the submachine or composite state.

Choice

Fork Fork pseudostate vertices serve to split an incoming transition into two or more transitions Join Join pseudostate merges several transitions originating from source vertices in different orthogonal regions. The transitions entering a join vertex cannot have guards or triggers.

Junction Junction pseudostate vertices are vertices that are used to chain together multiple transitions. They are used to construct compound transition paths between states. Final state is a special kind of state signifying that the enclosing region is completed.

Behavioral Transition A transition is a directed relationship between a source vertex and a target vertex. transition ::=[ triggers ]  [ guard ]  [ '/' behavior-expression ]  triggers ::= trigger  [ ','  trigger ]*  guard ::=  '[' constraint ']'

Optional list of triggers specifies events that may induce state transition.  Since more than one transition may be enabled by the same event, it is a necessary but not sufficient condition for the firing of a transition. The guard-constraint is a Boolean expression written in terms of parameters of the triggering event and attributes and links of the context object. The behavior-expression is executed if and when the transition fires.

UML Protocol State Machine Diagrams

UML Protocol State Machine Diagrams UML protocol state machine diagrams are used to express a usage protocol or a lifecycle of some classifier. It shows which operations of the classifier may be called in each state of the classifier, under which specific conditions, and satisfying some optional postconditions after the classifier transitions to a target state.

UML Protocol State Machine Diagrams Because these diagrams show lifecycle, they are useful to show different stable states of a class of objects which could exist for some time, and to explain how objects could change their states over the time. For example, we can show how User Account could be created, activated, suspended, and cancelled.

Major elements of the protocol state machine diagram are   protocol transition, different pseudostates

Protocol State The states of a protocol state machine (protocol states) present an external view of the class that is exposed to its clients.

Protocol Transition

Activity Diagram

Activity Diagram Activity diagram is UML behavior diagram which shows flow of control or object flow with emphasis on the sequence and conditions of the flow.

Activity Diagram The following nodes and edges are typically drawn on UML activity diagrams:  activity,  partition,  action,  object,  control,  activity edge.

Activity Activity is a parameterized behavior represented as coordinated flow of actions. The flow of execution is modeled as activity nodes connected by activity edges. A node can be the execution of a subordinate behavior, such as an arithmetic computation, a call to an operation, or manipulation of object contents.

Activity contains activity nodes which could be: action object control

Activity Partition An activity partition is activity group for actions that have some common characteristic.

Activity Edge Edge with guard condition