University of Toronto at Scarborough © Kersti Wain-Bantin CSCC40 state charts 1 object states an object state is a condition or situation during the life.

Slides:



Advertisements
Similar presentations
Nested state diagrams:Problems with flat state diagram
Advertisements

Concepts & Notations. Acknowledgements  The material in this tutorial is based in part on: Concurrency: State Models & Java Programming, by Jeff Magee.
Behavioral Modeling: State Diagrams CIS 4800 Kannan Mohan Department of CIS Zicklin School of Business, Baruch College Copyright © 2009 John Wiley & Sons,
Activity Diagrams in UML. Definition Activity diagrams represent the dynamics of the system. They are flow charts that are used to show the workflow of.
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.
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.
7M701 1 Activity Diagram. 7M701 2 Example 7M701 3 Activity Diagram: what is it? Describes activities and flows of data or decisions between activities.
03/12/2001 © Bennett, McRobb and Farmer Specifying Control Based on Chapter 11 of Bennett, McRobb and Farmer: Object Oriented Systems Analysis and.
Slide 10B.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with.
1 © Wolfgang Pelz UML2 UML Part Two. 2 © Wolfgang Pelz UML2 Chapters Four & Twelve Interaction Diagrams.
State Machine Diagrams (State Chart in UML 1) Specifying Control (ref: Chapter 11 Bennett, Mc Robb and Farmer)
System behaviors: state machine diagrams
1 © Wolfgang Pelz UML2 UML Part 3. 2 © Wolfgang Pelz UML2 Chapter Ten State Machine 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.
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.
SE-565 Software System Requirements More UML Diagrams.
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.
מידול התנהגותי 1. Today’s Session Sequence Diagrams State Machines 2.
1 Object-Oriented Modeling Using UML (2) CS 3331 Fall 2009.
Slide 16B.51 © The McGraw-Hill Companies, 2005 Object-Oriented and Classical Software Engineering.
Business Informatics Group Institute of Software Technology and Interactive Systems Vienna University of Technology Favoritenstraße 9-11/188-3, 1040 Vienna,
Object-Oriented Systems Analysis and Design Using UML
University of Toronto at Scarborough © Bennett, McRobb and Farmer 2005 CSCC40 state diagrams 1 state machine for the class GradeRate. Movement from one.
Sequence & Statechart Diagrams Month Day, Year. Agenda Training Plan Overview Actors and Use Case Diagrams Sequence Diagrams Diagram Elements Evolution.
CSIS3600 System Analysis and Design Statechart Diagrams.
1 A Student Guide to Object- Oriented Development Chapter 7 State Diagrams.
University of Toronto at Scarborough © Kersti Wain-Bantin CSCC40 Use Case 1 what are use cases? “A specification of sequences of actions, including variant.
7 Systems Analysis and Design in a Changing World, Fifth Edition.
Information System Design IT60105
Software Engineering Design & Modeling Statechart Diagram.
WXGC6102: Object-Oriented Techniques Specifying Control References: Chapter 10 of Bennett, McRobb and Farmer: Object Oriented Systems Analysis and Design.
1 Kyung Hee University Statecharts Spring Kyung Hee University Specifying Objects’ Behaviour  Interaction diagrams show message-passing behaviour.
University of Toronto at Scarborough © Kersti Wain-Bantin CSCC40 collaboration diagrams 1 show how classes might interact to deliver the functionality.
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 UML State Diagrams.
Dynamic Models Sequence Diagrams Collaboration Diagrams Activity Diagrams.
Systems Analysis and Design in a Changing World, Fourth Edition
States.
UML: State Chart Diagrams
CS3773 Software Engineering Lecture 06 UML State Machines.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 26. Review UML behavioral Diagrams – Sequence diagram.
Essentials of Visual Modeling w/ UML Instructor Notes
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.
Modeling Object Lifecycles and State-Dependent Behavior ©SoftMoore ConsultingSlide 1.
 The Sequence Diagram models the collaboration of objects based on a time sequence.  It shows how the objects interact with others in a particular scenario.
1 Kyung Hee University Interaction Diagrams Spring 2001.
1 7 Systems Analysis and Design in a Changing World, 2 nd Edition, Satzinger, Jackson, & Burd Chapter 7 The Object-Oriented Approach to Requirements.
University of Toronto at Scarborough © Kersti Wain-Bantin CSCC40 sequence diagrams 1 synchronous indicates nested flow of control used to ensure that state.
York University Department of Computer Science © Castro, Mylopoulos and Easterbrook Lecture 11: Modelling “State”  What is State?  statespace.
State Modeling. Introduction A state model describes the sequences of operations that occur in response to external stimuli. As opposed to what the operations.
Concurrency/synchronization using UML state models November 27th, 2007 Michigan State University.
State transition modeling
Identifying & Creating Use Cases – Part 2
State Machine Diagrams
CSC 422 Kutztown University Dr. Spiegel
States.
Object Oriented System Design
Chapter 5 state Modeling
States.
Systems Analysis and Design I
Identifying & Creating Use Cases - Part 3
Behavior How the Use Case is achieved
Presentation transcript:

University of Toronto at Scarborough © Kersti Wain-Bantin CSCC40 state charts 1 object states an object state is a condition or situation during the life of an object during which it: satisfies some condition or performs some activity or waits for some event the current state of an object determines how it will behave the current state of an object is determined by: current values of attributes and current links with other objects

University of Toronto at Scarborough © Kersti Wain-Bantin CSCC40 state charts 2 an object moves from one state to another by a transition which is either: triggered by an event or the state simply finishes (triggerless transition) statechart diagram is a model of: all the states and object can have the events that cause transitions all possible responses to all use cases Not all messages an object can receive will alter its state, in particular messages that do not cause changes to attributes or links (e.g. “get” and “query”)

University of Toronto at Scarborough © Kersti Wain-Bantin CSCC40 state charts 3 events may trigger action by actor or object time end of designated time period after [time expression] change when a condition becomes true when [Boolean expression] signal receipt of an asynchronous communication signal call receipt of call for an operation (synchronous) from self or other object events event-signature [guard-condition] / return-value:= action-expression

University of Toronto at Scarborough © Kersti Wain-Bantin CSCC40 state charts 4 event-signature [guard-condition] / return-value:= action-expression event-signature operation (parameter-list) guard-conditionBoolean expression action expressionoperation (paramter-list) an example showing multiple actions... leftMouseDown(location) [validItemSelected] / menuChoice:= pickMenuItem(location); menuChoiceHighlight ( ) three more examples... /assignManager ( ) ; assignStaff ( ) authorization (authorizationCode) [contract signed] / setCampaignActive ( ) paymentReceived ( payment) [paymentDue – payment <= zero] / A[B]/C if told to do A and B is true, then also do C, causing a state change if told to do A and B is false, then don’t do C and state does not change if no guard condition, then state always changes

University of Toronto at Scarborough © Kersti Wain-Bantin CSCC40 state charts 5 labels and notation event-signature [guard-condition] / return-value:= action-expression

University of Toronto at Scarborough © Kersti Wain-Bantin CSCC40 state charts 6 basic notation

University of Toronto at Scarborough © Kersti Wain-Bantin CSCC40 state charts 7 statechart for the class DiscountRate createDiscount- Rate ( )

University of Toronto at Scarborough © Kersti Wain-Bantin CSCC40 state charts 8 hospital patient

University of Toronto at Scarborough © Kersti Wain-Bantin CSCC40 state charts 9 online order

University of Toronto at Scarborough © Kersti Wain-Bantin CSCC40 state charts 10 video store – movie title

University of Toronto at Scarborough © Kersti Wain-Bantin CSCC40 state charts 11 online order

University of Toronto at Scarborough © Kersti Wain-Bantin CSCC40 state charts 12 alarm system

University of Toronto at Scarborough © Kersti Wain-Bantin CSCC40 state charts 13 fax machine

University of Toronto at Scarborough © Kersti Wain-Bantin CSCC40 state charts 14 concurrent substates in this example, either transition T1 or T2 can cause the object to leave any of states A1, A2, A3 or B1, B2, B3 and until either T1 or T2 occurs, the object remains in substate 1 and substate 2 A1A2 A3 B1B2 B3 T1T2

University of Toronto at Scarborough © Kersti Wain-Bantin CSCC40 state charts 15 when developing state charts... what are the major system events? what objects are affected by these events? (state charts are created) what alternate scenarios exist? (state charts are enhanced) are the state charts consistent with all use cases, collaboration and sequence diagrams? (state charts are corrected if necessary)

University of Toronto at Scarborough © Kersti Wain-Bantin CSCC40 state charts 16 when checking statecharts... every event  appears as an incoming message for the appropriate object in the right interaction (sequence or collaboration) diagram?  corresponds to an operation on the appropriate class? every action  appears as an operation in that object’s class? every outgoing message  corresponds to an operation in another class?

University of Toronto at Scarborough © Kersti Wain-Bantin CSCC40 state charts 17 example: Menu Visible state for a DropDownMenu object Entry action causes the menu to be displayed Event itemSelected() triggers the action highlightItem() Exiting the state triggers hideMenu() While the object remains in the Menu Visible state, the activity causes a sound clip to be played

University of Toronto at Scarborough © Kersti Wain-Bantin CSCC40 state charts 18 Synchronized Concurrent Threads. Synchronization bar n Explicitly showing how an event triggering a transition to a state with nested concurrent states causes specific concurrent substates to be entered n Shows that the composite state is not exited until both concurrent nested statecharts are exited