State Machine Diagrams (State Chart in UML 1) Specifying Control (ref: Chapter 11 Bennett, Mc Robb and Farmer)

Slides:



Advertisements
Similar presentations
1 CIS224 Software Projects: Software Engineering and Research Methods Lecture 6 State Machine and Activity Diagrams (Based on Stevens and Pooley (2006,
Advertisements

StateChart Diagrams State Machines Overview Change summary –core constructs –notation Examples Backward compatibility User benefits Issues.
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
Behavioral Modeling: State Diagrams CIS 4800 Kannan Mohan Department of CIS Zicklin School of Business, Baruch College Copyright © 2009 John Wiley & Sons,
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.
ZEIT2301 Design of Information Systems Behavioural Design: State Machines School of Engineering and Information Technology Dr Kathryn Merrick.
Chapter 6: Behavioral Modeling
© 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.
Sequence Diagrams. Introduction A Sequence diagram depicts the sequence of actions that occur in a system. The invocation of methods in each object, and.
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.
Summary Class responsibility cards can be used to help allocate responsibilities between different classes. The use of stereotype classes, such as entity,
03/12/2001 © Bennett, McRobb and Farmer Specifying Control Based on Chapter 11 of Bennett, McRobb and Farmer: Object Oriented Systems Analysis and.
2007ACS-3913 R. McFadyen1 UML Statechart Diagram A UML Statechart Diagram describes states for an object how/why an objects’ state changes A Statechart.
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.
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.
UML Sequence Diagrams Eileen Kraemer CSE 335 Michigan State University.
Systems Analysis and Design in a Changing World, 6th Edition
Unified Modeling Language
UML Sequence Diagrams Michael L. Collard, Ph.D. Department of Computer Science Kent State University.
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.
CS3773 Software Engineering
Class, Sequence and UML Model.  Has actors and use cases.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
State Diagrams / System Sequence Diagrams (SSDs)
Software Engineering Chapter 8 Fall Analysis Extension of use cases, use cases are converted into a more formal description of the system.Extension.
State diagrams Interaction diagrams –Sequence diagrams –Collaboration diagrams Object orientation Part 4: Dynamic Modeling.
1 Software Engineering Dr. K. T. Tsang Lecture 8 State modeling
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 25. Review Design Level Class Diagram Identifying classes/Operations/Attributes Associations – Simple associations.
Systems Analysis and Design in a Changing World, Fifth Edition
Systems Analysis and Design in a Changing World, 6th Edition
Dynamic Modeling Chapter 11 Part of Analysis Modeling Designing Concurrent, Distributed, and Real-Time Applications with UML Hassan Gomaa (2001)
Behavioral Modeling Chapter 8.
1 A Student Guide to Object- Oriented Development Chapter 7 State Diagrams.
7 Systems Analysis and Design in a Changing World, Fifth Edition.
The Unified Modeling Language Part II Omar Meqdadi SE 2730 Lecture 9 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Course Instructor: Kashif Ihsan 1. Chapter # 3 2.
Information System Design IT60105
Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.
CS212: Object Oriented Analysis and Design Lecture 34: UML Activity and Collaboration diagram.
State Modeling. Events An event is an occurrence at a point in time, such as user depresses left button or.
Dynamic Models Sequence Diagrams Collaboration Diagrams Activity Diagrams.
Systems Analysis and Design in a Changing World, Fourth Edition
CS3773 Software Engineering Lecture 06 UML State Machines.
State Chart diagram Week objective Describe State chart Diagrams in Dynamic Modelling 2.
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.
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.
Capturing Requirements. Questions to Ask about Requirements 1)Are the requirements correct? 2)Consistent? 3)Unambiguous? 4)Complete? 5)Feasible? 6)Relevant?
State Machine Diagram Chapter 5 Introduction Pages
State Modeling. Introduction A state model describes the sequences of operations that occur in response to external stimuli. As opposed to what the operations.
State Machine Diagram.
TIM 58 Chapter 6, continued: Behavioral Modeling
State Machine Diagrams
Unified Modeling Language
State Machine Diagrams
Princess Nourah bint Abdulrahman University
Object Oriented System Design
CS/CPE 426 Senior Projects
UML Diagrams: Sequence Diagrams Dynamic Analysis Model
Chapter 5 state Modeling
CS/CPE 426 Senior Projects
CS 791Z State Machines & Advanced State Machines
Appendix 3 Object-Oriented Analysis and Design
Behavioral Diagrams P. P. Mahale
UML State Diagrams (Ch. 29)
Presentation transcript:

State Machine Diagrams (State Chart in UML 1) Specifying Control (ref: Chapter 11 Bennett, Mc Robb and Farmer)

“A model of state behaviour in a state machine captures all possible responses of a single object to all the use cases in which it is involved.”(Bennett et al) models the different states that a class can be in and how that class transitions from state to state “depict the dynamic behavior of an entity based on its response to events, showing how the entity reacts to various events depending on the current state that it is in.” (agilemodelling.com)

All objects have a STATE What determines an object’s state? What can change an object’s state? How can we describe an object’s state? Can an object respond differently to the same message depending on what state it is in?

e.g. Frogger A frog object can be....

Object State determined by Attribute values and related objects We name key states using simple and easy to understand names for states e.g. A frog can be pending, active, dead, alive, have one life left.... or whatever way you need to define them. Triggers change states/ initiate transitions

Triggers Triggers are events which start state changes in objects. Where have we seen the word ‘trigger’ used before? A transition is the movement from one state to another

Types of trigger Change trigger : some condition becomes true – described as a boolean expression[...] – Need to distinguish from a guard condition [..] which is evaluated when its associated event fires. Call trigger : object gets sent a message- described by message signature Signal trigger : Object receives a signal – described by signature Relative time trigger : passage of a designated amount of time after an event- described by time expressions

What triggers might affect the state of a frog?

Notation for state machine diagrams – Each node is known as a vertex - black dot for start - arrows denote transitions and triggers can be specified for these -- a state is a rounded box - circled black dot for endstate

See fig 11.1 page 306 Bennett et al

Example Draw the different states a current bank account can be in. Note that an account can be opened and closed. How will the response to a “withdraw money” event depend on the state of the bank account?

Question “Black Hole” States. A black hole state is one that has transitions into it but none out. Question “Miracle” States. A miracle state is one that has transitions out of it but none into it. (agilemodelling.com)

Example – lifecycle of a seminar(module) (source: )ttp://

More detailed diagram (A seminar is in the Open For Enrolment state when it has been flagged as open and there are seats available to be filled. adapted from source: )ttp:// Examples of guards StartInitial state trigger Final state

Example : Monopoly Williams 2004

Adding detail See fig 11.5 page 310 Bennett et al Note that more detail can go into the state box and that different activities can be specified for entry and exit See fig 11.6 page 310 Bennett et al Note the detail for each transition: – Trigger signature of the operation that triggered the transition – Guard condition ensuring that it is OK to transition – Activity expression listing things to do then

Sequence or interaction diagrams can be used to help draw state machine diagrams as they show message passing between objects over time. We look at all messages sent to an object in all the interaction diagrams for use cases and examine the impact of these on the state of the object Through this identify what states the object might go through.

See fig page 321 Bennett et al

See fig page 322 Bennett et al Note the active state expanded to provide more detail This means that we can have sub-states within a state.

Lifecycle approach to state modelling Identify major system events and which classes they affect For each class affected draw rough (1 st cut) state machine diagrams Examine and elaborate Enhance with alternative scenarios Review for consistency and check constraints

Concurrent States See Bennett et al p332 Fig A4.4 Note that an object’s state can be the product of two or more sub-states if different things can happen concurrently

History pseudostate See Bennett et al p331 Fig A4.3 See what happens when the campaign goes into a suspended state. The history of where it was needs to be saved and re-instated when the suspended state ends.

Summary State machine diagrams show the dynamic behaviour of systems by showing the different states that objects can be in and the events/ triggers and rules that determine the transition from one state to another.

References artDiagram.htm artDiagram.htm Bennett et al Chapter 11