1 CS/CPE 426 Senior Projects Chapter 21: State Machines Chapter 22:Advanced State Machines [Arlow and Neustadt 2005] March 24, 2009.

Slides:



Advertisements
Similar presentations
StateChart Diagrams State Machines Overview Change summary –core constructs –notation Examples Backward compatibility User benefits Issues.
Advertisements

State Charts Mehran Najafi. Reactive Systems A reactive, event-driven, object is one whose behavior is best characterized by its response to events dispatched.
Nested state diagrams:Problems with flat state diagram
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.
© 2006 ITT Educational Services Inc. SE350 System Analysis for Software Engineers: Unit 9 Slide 1 Appendix 3 Object-Oriented Analysis and Design.
1 Chapter 4 Dynamic Modeling and Analysis (Part I) Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence.
1 Chapter 4 Dynamic Modeling and Analysis (Part I) Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence.
Activity Diagrams [Arlow and Neustadt, 2005] CS 425 / 625 Seminar on Software Engineering University of Nevada, Reno Department of Computer Science & Engineering.
1 CS 426 Senior Projects Chapter 4: Use Case Modeling [Arlow and Neustadt, 2002] February 8, 2007.
1 CS 426 Senior Projects Chapter 9: Relationships Chapter 10: Inheritance and Polymorphism [Arlow and Neustadt, 2005] February 12, 2009.
1 CS 426 Senior Projects Chapter 19: Interfaces and Components [Arlow & Neustadt 2005] February 28, 2008.
Mastering the Unified Modeling Language -- State Transition Diagrams -- © Josef Schiefer, IBM Watson.
1 CS 691z/791z Topics in Software Engineering Chapter 13: Activity Diagrams & Chapter 19: Basic Statecharts [Arlow and Neustadt, 2002] March 8, 2007.
State Diagram. What is State Diagram?  State diagram is used to show the state space of a given class, the events that cause a transition from one state.
1 CS 426 Senior Projects Chapter 9: Relationships Chapter 10: Inheritance and Polymorphism [Arlow and Neustadt, 2002] February 27, 2007.
State Machine Diagrams (State Chart in UML 1) Specifying Control (ref: Chapter 11 Bennett, Mc Robb and Farmer)
1 CS 426 Senior Projects Chapter 14: Activity Diagrams [Arlow and Neustadt, 2005] February 17, 2009.
1 CS 691z/791z Topics in Software Engineering Chapter 20: Advanced Statechart Modeling [Arlow and Neustadt, 2002] March 8, 2007.
1/31 CS 426 Senior Projects Chapter 1: What is UML? Chapter 2: What is UP? [Arlow and Neustadt, 2005] January 22, 2009.
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.
1 CS 426 Senior Projects Chapter 4: Use Case Modeling [Arlow and Neustadt, 2005] February 5, 2009.
1 CS 691z / 791z Topics on Software Engineering Chapter 17: Interfaces and Subsystems [Arlow & Neustadt, 2002] March 6, 2007.
Advanced Behavioral Modeling
1 CS 426 Senior Projects Chapter 1: What is UML? Chapter 2: What is UP? [Arlow and Neustadt, 2002] January 26, 2006.
SE-565 Software System Requirements More UML Diagrams.
© 2008 IBM Corporation Behavioral Models for Software Development Andrei Kirshin, Dolev Dotan, Alan Hartman January 2008.
An Introduction to Rational Rose Real-Time
UML Sequence Diagrams Michael L. Collard, Ph.D. Department of Computer Science Kent State University.
What is UML? What is UP? [Arlow and Neustadt, 2005] January 23, 2014
Lecture 4 Finite State Machine CS6133 Software Specification and Verification.
Chapter 10 State Machine Diagrams
מידול התנהגותי 1. Today’s Session Sequence Diagrams State Machines 2.
Business Informatics Group Institute of Software Technology and Interactive Systems Vienna University of Technology Favoritenstraße 9-11/188-3, 1040 Vienna,
NJIT Modeling Behavior in State Chart Diagrams Chapter 29 Rafael Mello.
Behavioral diagrams Lecture p4 T120B pavasario sem.
Session 22 Modeling the Extended Features of the Statechart Written by Thomas A. Pender Published by Wiley Publishing, Inc. October 27, 2011 Presented.
Real Time Systems Modeling Structure in UML (Part I)
Information System Design IT60105
Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2006 State Behavior Patrick Bailey Keith Vander Linden Calvin College.
States.
CS3773 Software Engineering Lecture 06 UML State Machines.
1 Technical & Business Writing (ENG-715) Muhammad Bilal Bashir UIIT, Rawalpindi.
Chapter 14: Activity Diagrams November 2015 [Arlow and Neustadt, 2005] CS 425/625 Senior Projects University of Nevada, Reno Department of Computer Science.
Modeling Object Lifecycles and State-Dependent Behavior ©SoftMoore ConsultingSlide 1.
Chapter 9: Relationships Chapter 10: Inheritance and Polymorphism [Arlow and Neustadt, 2005] CS 426 Senior Projects in Computer Science University of Nevada,
® IBM Software Group © 2009 IBM Corporation Module 11: Creating State Machine Diagrams Essentials of Modeling with IBM Rational Software Architect V7.5.
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 Advanced UML State Diagrams.
State Machine Model.
State Diagram – Advanced Concepts
State Machine Diagram.
What is UML? What is UP? [Arlow and Neustadt, 2005] October 5, 2017
Advanced state modeling
State Machine Diagrams
CS 426 Senior Projects Chapter 9: Relationships
UML Activity Diagrams & State Charts
States.
CS/CPE 426 Senior Projects
Chapter 14: Activity Diagrams
CS/CPE 426 Senior Projects
Chapter 14: Activity Diagrams
States.
Advanced state modeling
Chapter 14: Activity Diagrams
CS 791Z State Machines & Advanced State Machines
Interfaces and Components
Behavioral Diagrams P. P. Mahale
UML State Diagrams (Ch. 29)
Presentation transcript:

1 CS/CPE 426 Senior Projects Chapter 21: State Machines Chapter 22:Advanced State Machines [Arlow and Neustadt 2005] March 24, 2009

2 Outline State machines: Introduction State machine diagrams States Transitions Events Advanced state machines: Composite states Simple Orthogonal Submachine states Submachine communication History

3 Introduction Both activity diagrams and state machine diagrams model system behavior However, they have different semantics: Activity diagrams are based on Petri Nets and usually model processes when several objects participate State machine are based on Harel’s statecharts and typically used to model single reactive objects

4 Introduction Reactive objects: Respond to external events May generate and respond to internal events Have a lifecycle modeled as a progression of states, transitions and events May have current behavior that depends on past behavior State machines are used to model behavior of classifiers such as classes, use cases, subsystems, systems

5 Introduction There are two types of state machines: Behavioral state machines Protocol state machines State machines are most commonly used to model dynamic behavior of classes In UP, state machines can be used in: requirements, analysis, design A significant challenge is testing state machines: manual walkthrough, simulation, code generation + test harnesses for state machines

6 State machine diagrams There are three main modeling elements in state diagrams: states transitions, and events. Example of a simple state machine, Fig [Arlow & Neustadt]

7 States Summary of UML state syntax, Fig.21.4 [Arlow & Neustadt 2005]

8 Transitions Summary of UML syntax for transitions in behavioral state diagrams, Fig.21.5 [Arlow & Neustadt 2005] Where: event(s)= internal or external occurrence(s) that trigger the transition guardCondition = boolean expression, when true the transition is allowed anAction = some operation that takes place when the transition fires

9 Transitions Summary of UML syntax for transitions in protocol state diagrams, Fig.21.6 [Arlow & Neustadt 2005] Note that there is no action and guard conditions are replaced by preconditions and postconditions.

10 Transitions A junction pseudo-state represents a point where transitions merge or branch, e.g. Fig.21.7 [Arlow & Neustadt 2005]

11 Transitions A junction pseudo-state may have more than one output transition (protected by mutually exclusive guard conditions) e.g. Fig.21.8 [Arlow & Neustadt 2005]

12 Transitions Choice pseudo-state can also be used, e.g. Fig [Arlow & Neustadt 2005]

13 Events Events can be of four types: Call event Signal event Change event Time event

14 Events Example of a call event, Fig [Arlow & Neustadt 2005]

15 Events A signal is a package of information sent asynchronously between objects. Example of signal event Fig [Arlow & Neustadt 2005] Example of sending a Signal Fig [Arlow & Neustadt 2005]

16 Events Change events are positive edge triggered. Example of a change event, Fig [Arlow & Neustadt 2005]

17 Events Time events are indicated by the keywords when and after. Example of a time event, Fig [Arlow & Neustadt, 2002]

18 Example of a state machine [Dascalu 2001]

19 Composite states A composite state contains one or more nested state machines (submachines), each existing in its own region, Fig 22.2 [Arlow & Neustadt 2005]. The composition icon is shown in Fig. 22.4

20 Simple composite states A superstate that contains a single region is called a simple composite state, e.g. Fig 22.5 [Arlow & Neustadt 2005]

21 Orthogonal composite states Orthogonal composite states consist of two or more sub-machines that execute in parallel. In Fig 22.6 [Arlow & Neustadt 2005] there are two such composite states, Initializing and Monitoring

22 Orthogonal composite states The composite state Initializing, Fig 22.7 [Arlow & Neustadt 2005]

23 Orthogonal composite states The composite state Monitoring, Fig 22.8 [Arlow & Neustadt 2008]

24 Submachine states A submachine state is a special state that references a state machine recorded in a separate diagram, e.g. Fig [Arlow and Neustadt 2005]

25 Submachine states Fig [Arlow & Neustadt 2005]. The notation for a submachine state is

26 Submachine communication Asynchronous submachine communication can be achieved via attributes: The modeled reactive object has a set of attributes that can be used by submachines The communication mechanism: one machine sets attributes and the other uses the attribute values in guard conditions of their transitions

27 Submachine communication Example of communication via attributes, Fig [A&N 2005]

28 History Example of using the shallow history indicator, Fig [Arlow & Neustadt 2005]

29 History Example of using the deep history indicator Fig [Arlow & Neustadt 2005]