State Diagram – Advanced Concepts

Slides:



Advertisements
Similar presentations
NCKU EE RTES LAB.1 Unified Modeling Language - Events and State Machines.
Advertisements

StateChart Diagrams State Machines Overview Change summary –core constructs –notation Examples Backward compatibility User benefits Issues.
Nested state diagrams:Problems with flat state diagram
State Machine Model. C-S 5462 State Machine View describes the dynamic behavior of objects over time –each object is treated in isolation –the view describes.
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.
Unified Modeling Language Unit 4. Dynamic Modeling.
Software engineering Methods Software Engineering Methods State Diagrams Zvi Avidor Written By With additions by Zvika Gutterman and Adam Carmi.
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/CPE 426 Senior Projects Chapter 21: State Machines Chapter 22:Advanced State Machines [Arlow and Neustadt 2005] March 24, 2009.
THE OBJECT-ORIENTED DESIGN WORKFLOW Statechart Diagrams.
UML Notations Activity diagrams State diagrams Class diagrams Use-case diagrams.
Advanced Behavioral Modeling
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 10: Statecharts.
1 Lab Beginning Analysis and Design 4 Completion of first version of use case diagram initiates the processes of analysis and design. 4 UML provides.
Activity Diagram. C-S 5462 Activity diagram a diagram that represents a sequence of activities similar to flow chart, used in 1960’s and 1970’s an activity.
Lecture 4 Finite State Machine CS6133 Software Specification and Verification.
Chapter 10 State Machine Diagrams
מידול התנהגותי 1. Today’s Session Sequence Diagrams State Machines 2.
1 Object-Oriented Modeling Using UML (2) CS 3331 Fall 2009.
Fall 2010 CS4310 Requirements Engineering UML: Dynamic Modeling Dr. Guoqiang Hu Department of Computer Science UTEP 1.
Systems Analysis and Design in a Changing World, Fifth Edition
Behavioral diagrams Lecture p4 T120B pavasario sem.
Object-Oriented Modeling Using UML CS 3331 Section 2.3 of Jia 2003.
11 Software Engineering Dr. K. T. Tsang Lecture 9 Advance State Modeling
Activity & Class Modeling Labs Discussion p3 T120B pavasario sem.
1 A Student Guide to Object- Oriented Development Chapter 7 State Diagrams.
1 Kyung Hee University Statecharts Spring Kyung Hee University Specifying Objects’ Behaviour  Interaction diagrams show message-passing behaviour.
Dynamic Models. Outline Dynamic Models Statecharts –States –Transitions –Composite states Interaction Diagrams –Sequence Diagrams The time order of interactions.
States.
CS3773 Software Engineering Lecture 06 UML State Machines.
Modeling Object Lifecycles and State-Dependent Behavior ©SoftMoore ConsultingSlide 1.
1 7 Systems Analysis and Design in a Changing World, 2 nd Edition, Satzinger, Jackson, & Burd Chapter 7 The Object-Oriented Approach to Requirements.
Introduction to UML and Rational Rose UML - Unified Modeling Language Rational Rose 98 - a GUI tool to systematically develop software through the following.
® 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.
Activity Diagram.
State transition modeling
Appendix 3 Object-Oriented Analysis and Design
Business System Development
State Machine Model.
The Movement To Objects
State Machine Diagram.
Course Outcomes of Object Oriented Modeling Design (17630,C604)
Object-Oriented Analysis and Design
Building System Models for RE
Interaction View.
Dynamic Modeling of Banking System Case Study - I
Static and Dynamic Modeling Using UML
State Machine Diagrams
UML SEQUENCE AND CLASS DIAGRAMS
Business System Development
UML Activity Diagrams & State Charts
States.
CS/CPE 426 Senior Projects
Advanced State Chart diagrams
SAD ::: Spring 2018 Sabbir Muhammad Saleh
CIS 375 Bruce R. Maxim UM-Dearborn
CS/CPE 426 Senior Projects
Systems Analysis – ITEC 3155 Modeling System Requirements – Part 2
Using Use Case Diagrams
States.
CHAPTER 2 Object-Oriented Modeling Using UML (Continued)
CS 791Z State Machines & Advanced State Machines
CIS 375 Bruce R. Maxim UM-Dearborn
UML State Diagrams.
Appendix 3 Object-Oriented Analysis and Design
Behavioral Diagrams P. P. Mahale
Modeling Behavior in Statechart Diagrams
Copyright © 2015, 2012, 2009 Elsevier Inc. All rights reserved.
Presentation transcript:

State Diagram – Advanced Concepts

Communications between objects Objects communicate by sending messages to each other. Messages are realized by events and transitions in state diagram. The object that sends a message is said to generate an event. Modeled by the action associated with the transition The object that receives the message is said to realize / accept that event.

Communication between three state machines GUI object Open / generateAccountNumber(act) ^ Account.open(); Database.openAccount(act) Some State Some other State Account object open Initial Database object openAccount (act) / addAccount(act) Some State Communication between three state machines

Expanded syntax for transition A transition is specified using the following syntax in order to show the communication between the objects event-name (parameters) [guard] / action-sequence ^ send-clause where ‘send-clause’ is specified as object.event-name (parameters); …

Messages shown in state diagrams Remote Control On Off On Off On() Play Stop Off() Play() Stop() CD Player On Play On & Play Off On & Stop Off Stop Off

Simple and composite states A state is composite, in contrast to a simple state, if it has a decomposition UML Manual version 1.5 A composite state includes nested substates A diagram for a composite state has two or more sub-diagrams connected by simple and/or concurrent transitions The entry point of a substate is connected to the initial state of the substate The exit point of a substate is connected to all final states of the substate

Composite state with or-substates Running Forward Backward The states of a running car

Or-substates Also called orthogonal states in UML 2.0 The composite state has two or more mutually exclusive substates When the object is in the composite state, only one of the substates is active In the previous diagram, the running car will be in ‘forward’ state or in ‘backward’ state at any time but not in both Each substate can be explained by a separate state diagram

Composite state with and-substates Running Forward Backward Low Speed High Speed The states of a running car

And-substates Also called non-orthogonal states in UML 2.0 The composite state has two or more concurrent substates When the object is in the composite state, every one of the concurrent substates is active In the previous diagram, the running car will be in one of the four states: ‘forward & low speed’, ‘forward & high speed’, backward & low speed’ and ‘backward & high speed’ Each substate can be explained by a separate state diagram

Or-substates – Another Example Eject No CD loaded Power ON [no CD] Eject [CD in] Power OFF Power ON [CD in] CD loaded

Expanded state diagram No CD Loaded Eject CD drawer closed CD drawer open Power OFF Power ON [no CD] Eject [no CD] Eject Eject [CD in] CD loaded Power ON [CD in] CD playing Pause CD paused Pause or Play Power OFF Stop Stop CD stopped Play

And-substates – another example Student attending a course Incomplete Lab done Lab done Complete Lab 1 Complete Lab 2 passed Project done Complete Project Complete Final exam pass fail failed

Observation If there is a transition from any one of the substates that lead to a state outside the composite state, then all the other concurrent substates terminate prematurely The transition “fail” in the third substate illustrates this situation

State diagrams and specialization Inheritance mechanism allows to redefine only behaviors of a superclass and not the structure of the superclass The structure of a subclass must be the same or a superset of the structure of the superclass Every state of a superclass object is also a valid state of the subclass object The state diagram of a superclass can be inherited into the state diagram of a subclass

Composite State - Exercise Draw a composite state diagram indicating the states of two phones when both of them are in use. Hint: First identify the various values for the status of a single phone