CS251 – Software Engineering Lectures 11 State Diagrams

Slides:



Advertisements
Similar presentations
State Diagram 1. State diagram: Shows the behavior of one object. They describe all of the possible states that a particular object can get into and how.
Advertisements

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.
ESE Einführung in Software Engineering 7. Modeling Behaviour Prof. O. Nierstrasz.
Introduction to Software Engineering 7. Modeling Behaviour.
© 2006 ITT Educational Services Inc. SE350 System Analysis for Software Engineers: Unit 9 Slide 1 Appendix 3 Object-Oriented Analysis and Design.
State Transition Diagrams
5/24/2015CPSC , CPSC , Lecture 71 Software Engineering, CPSC , CPSC , Lecture 7.
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 5, Analysis: Dynamic Modeling.
1 CS 691z/791z Topics in Software Engineering Chapter 13: Activity Diagrams & Chapter 19: Basic Statecharts [Arlow and Neustadt, 2002] March 8, 2007.
Chapter 8: Modelling Interactions and Behaviour
Essentials of state and activity diagram Lecture 24.
State Machine Diagrams (State Chart in UML 1) Specifying Control (ref: Chapter 11 Bennett, Mc Robb and Farmer)
Modeling Dynamic Behavior: State and Activity Diagrams.
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.
Chapter 8: Modelling Interactions and Behaviour
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.
University of Toronto Department of Computer Science © Steve Easterbrook. This presentation is available free for non-commercial use with attribution.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
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
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
Modelling Interactions and Behaviour. © Lethbridge/Laganière 2005 Chapter 8: Modelling Interactions and Behaviour2 Interaction Diagrams Interaction diagrams.
Chapter 8: Modelling Interactions and Behaviour UML Activity Diagram
1 Object-Oriented Modeling Using UML (2) CS 3331 Fall 2009.
Software Engineering 1 Object-oriented Analysis and Design Chap 29 UML State Machine Diagrams and Modeling.
NJIT Modeling Behavior in State Chart Diagrams Chapter 29 Rafael Mello.
Fall 2010 CS4310 Requirements Engineering UML: Dynamic Modeling Dr. Guoqiang Hu Department of Computer Science UTEP 1.
1 Software Engineering Dr. K. T. Tsang Lecture 8 State modeling
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
Object-Oriented Modeling Using UML CS 3331 Section 2.3 of Jia 2003.
1 Modeling interactions and behavior Lecturer Dr. Mai Fadel.
Modelling interactions and behaviour Adapted after : Timothy Lethbridge and Robert Laganiere, Object-Oriented Software Engineering – Practical Software.
1 A Student Guide to Object- Oriented Development Chapter 7 State Diagrams.
Discovering object interaction. Use case realisation The USE CASE diagram presents an outside view of the system. The functionality of the use case is.
Course Instructor: Kashif Ihsan 1. Chapter # 3 2.
Modeling with UML The Unified Modeling Language (UML) is a standard graphical language for modeling an object-oriented software by providing a standard.
Information System Design IT60105
SWT - Diagrammatics Lecture 4/4 - Diagramming in OO Software Development - partB 4-May-2000.
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.
Interaction Diagram An interaction diagram is a graphical representation of interactions between objects. Sequence diagram: shows the sequence in which.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 26. Review UML behavioral Diagrams – Sequence diagram.
INFO 620Lecture #71 Information Systems Analysis and Design Design Class Diagrams and others INFO 620 Glenn Booker.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour Based on Presentations.
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.
MCS 270 Spring 2014 Object-Oriented Software Development.
Chapter 5 – System Modeling Lecture 9 Section A 27/4/2015 Section B 29/4/2015 1Chapter 5 System modeling.
Modeling Object Lifecycles and State-Dependent Behavior ©SoftMoore ConsultingSlide 1.
2/25/2016COSC , Lecture 191 Real-Time Systems, COSC , Lecture 19 Stefan Andrei.
1 Object Oriented Analysis System modeling = Functional modeling + Object modeling + Dynamic modeling Functional modeling = Use cases Object modeling =class.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
Systems Analysis and Design in a Changing World, Fourth Edition
State Machine Model.
UML State Diagrams.
Chapter 8: Modelling Interactions and Behaviour UML Activity Diagram
States.
Object Oriented System Design
CIS 375 Bruce R. Maxim UM-Dearborn
Chapter 5 state Modeling
States.
CIS 375 Bruce R. Maxim UM-Dearborn
Appendix 3 Object-Oriented Analysis and Design
Modeling Behavior in Statechart Diagrams
State-Transition Diagrams
Presentation transcript:

CS251 – Software Engineering Lectures 11 State Diagrams Read Reading 8 Chapter 8 (only 8.2) from OO SE 2/e, Slides by: Timothy Lethbridge

Chapter 5: Modelling with classes Last Lecture Where are we now ? why Modeling software ? Sequence diagram ? Chapter 5: Modelling with classes © Lethbridge/Laganière 2012

Chapter 5: Modelling with classes Outline State diagrams Modelling states and transitions Modelling activities and actions Examples Chapter 5: Modelling with classes © Lethbridge/Laganière 2012

Chapter 8: Modelling Interactions and Behaviour 8.2 State Diagrams A state diagram describes the behavior of a system, some part of a system, or an individual object. At any given point in time, the system or object is in a certain state. Being in a state means that it is will behave in a specific way in response to any events that occur. Some events will cause the system to change state. In the new state, the system will behave in a different way to events. A state diagram is a directed graph where the nodes are states and the arcs are transitions. Chapter 8: Modelling Interactions and Behaviour © Lethbridge/Laganière 2005

State diagrams – an example tic-tac-toe game Chapter 8: Modelling Interactions and Behaviour © Lethbridge/Laganière 2005

State diagrams – an example Chapter 8: Modelling Interactions and Behaviour © Lethbridge/Laganière 2005

Chapter 8: Modelling Interactions and Behaviour States At any given point in time, the system is in one state. A state is represented by a set of values for the attributes of the given object. It will remain in this state until an event occurs that causes it to change state. Chapter 8: Modelling Interactions and Behaviour © Lethbridge/Laganière 2005

Chapter 8: Modelling Interactions and Behaviour States A state is represented by a rounded rectangle containing the name of the state. Special states: A black circle represents the start state A circle with a ring around it represents an end state Chapter 8: Modelling Interactions and Behaviour © Lethbridge/Laganière 2005

Chapter 8: Modelling Interactions and Behaviour State Diagram States Transitions Events Activities Actions Initial state event transition state off hook Idle Active on hook Chapter 8: Modelling Interactions and Behaviour © Lethbridge/Laganière 2005

Chapter 8: Modelling Interactions and Behaviour Transitions A transition represents a change of state in response to an event. The label on each transition is the event that causes the change of state. Chapter 8: Modelling Interactions and Behaviour © Lethbridge/Laganière 2005

Example dial tone dialling idle digit (n) on-hook off-hook on-hook State Event Transition digit (n) digit (n) dial tone dialling on-hook off-hook on-hook idle

State diagrams – an example with conditional transitions action condition

State diagrams – an example with conditional transitions Add these info to the last state diagram (a) The course section can be canceled when in any state, except after it has been taught. (b) A student can drop out at any time, except after the course section has been taught.

Activities in state diagrams An activity is something that takes place while the system is in a state. It takes a period of time. The system may take a transition out of the state in response to completion of the activity, Some other outgoing transition may result in: The interruption of the activity, and An early exit from the state. Chapter 8: Modelling Interactions and Behaviour © Lethbridge/Laganière 2005

State diagram – an example with activity Audio Playing Chapter 8: Modelling Interactions and Behaviour © Lethbridge/Laganière 2005

Chapter 8: Modelling Interactions and Behaviour Types of Events External Event (also known as system event) is caused by something outside the system boundary e.g. when a cashier presses the “enter item” button on a POST, an external event has occurred. Internal Event is caused by something inside our system boundary. In internal event arises when an operation is invoked via a message sent from another internal object. Temporal Event is caused by the occurrence of a specific date and time or passage of time. Chapter 8: Modelling Interactions and Behaviour © Lethbridge/Laganière 2005

Actions in state diagrams An action is something that takes place effectively instantaneously When a particular transition is taken, Upon entry into a particular state, or Upon exit from a particular state An action should consume no noticeable amount of time Chapter 8: Modelling Interactions and Behaviour © Lethbridge/Laganière 2005

State diagram – an example with actions Chapter 8: Modelling Interactions and Behaviour © Lethbridge/Laganière 2005

Nested substates and guard conditions A state diagram can be nested inside a state. The states of the inner diagram are called substates. Chapter 8: Modelling Interactions and Behaviour © Lethbridge/Laganière 2005

State diagram – an example with substates Chapter 8: Modelling Interactions and Behaviour © Lethbridge/Laganière 2005

Chapter 8: Modelling Interactions and Behaviour © Lethbridge/Laganière 2005

Example: Online Chess

ExampleOnline Chess

ESE — Modeling Behaviour Example: Phone ESE — Modeling Behaviour © Oscar Nierstrasz

Chapter 5: Modelling with classes Outline State diagrams Modelling states and transitions Modelling activities and actions Examples Chapter 5: Modelling with classes © Lethbridge/Laganière 2012

Chapter 5: Modelling with classes Readings and Videos Very Important R8: Chapter 8 (Modeling interactions and behavior) of OOSE, 2nd ed by Timothy Lethbridge Read section 8.2 from page 291 to page 301 Appendix A: Summary of UML Syntax – page 471 and 472 http://agilemodeling.com/artifacts/stateMachineDi agram.htm Chapter 5: Modelling with classes © Lethbridge/Laganière 2012