March 200692.3913 R. McFadyen1 Statechart Diagram A Statechart Diagram describes states for an object how/why an objects’ state changes A Statechart Diagram.

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

NCKU EE RTES LAB.1 Unified Modeling Language - Events and State Machines.
1 CIS224 Software Projects: Software Engineering and Research Methods Lecture 6 State Machine and Activity Diagrams (Based on Stevens and Pooley (2006,
Withdrawal Transaction Use Case Primary Actor: Customer Pre-conditions: The customer must have a valid ATM card and PIN. Post-conditions: The customer.
Extending the Requirements Model - techniques for detailing use cases
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.
Chapter 12 ATM Case Study, Part 1: Object-Oriented Design with the UML
Interaction Diagrams Activity Diagram State Machine Diagram
Jan 16, Ron McFadyen1 Ch 9. Use-case model: drawing System Sequence Diagrams Iteration 1: a simple cash-only success scenario of Process Sale.
SE 555 Software Requirements & Specification 1 Activity Diagrams.
January Ron McFadyen1 Ch 9. Use-case model: drawing System Sequence Diagrams Elaboration Iteration 1: a simple cash-only success scenario of.
1 CS 691z/791z Topics in Software Engineering Chapter 13: Activity Diagrams & Chapter 19: Basic Statecharts [Arlow and Neustadt, 2002] March 8, 2007.
Sept Ron McFadyen Interaction Diagrams - Chapter 15 Describe/illustrate sequence of message exchanges among objects that are working together.
Lecture 4 Class Responsibility Collaboration Cards
Essentials of interaction diagrams Lecture 23 & 24.
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.
Essentials of state and activity diagram Lecture 24.
Fall 2009ACS Ron McFadyen1 The context maintains an instance of a concrete state subclass State Pattern Each subclass (concrete state) implements.
2007ACS-3913 R. McFadyen1 UML Statechart Diagram A UML Statechart Diagram describes states for an object how/why an objects’ state changes A Statechart.
Oct Ron McFadyen Visibility Visibility: the ability of one object to see or have a reference to another object. e.g. When a register object.
THE OBJECT-ORIENTED DESIGN WORKFLOW Statechart Diagrams.
Nov 2002 R. McFadyen1 Statechart Diagrams - Ch 29 Example: Suppose we have a class Copy, representing copies of books. We can consider two states:
System Analysis and Design
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.
Oct R. McFadyen1 Statechart Diagrams Example: Suppose we have a class Copy, representing copies of books. We can consider two states: available,
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.
Use Case Modeling. Use case diagram For each use case we develop  Object class diagram (with attributes only)  System sequence diagram (analysis) 
State Machines State diagrams SE-2030 Dr. Rob Hasker 1 Based on slides written by Dr. Mark L. Hornick Used with permission.
Chapter 10 State Machine Diagrams
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
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.
State diagrams Interaction diagrams –Sequence diagrams –Collaboration diagrams Object orientation Part 4: Dynamic Modeling.
Systems Analysis and Design in a Changing World, 6th Edition
Guide to State Transition Diagram. 2 Contents  What is state transition diagram?  When is state transition diagram used?  What are state transition.
Behavioral diagrams Lecture p4 T120B pavasario sem.
Object-Oriented Modeling Using UML CS 3331 Section 2.3 of Jia 2003.
UML -Part 3. Dynamic Diagram Types Interaction Diagrams - Set of objects or roles and the messages that can be passed among them. – Sequence Diagrams.
1 A Student Guide to Object- Oriented Development Chapter 7 State Diagrams.
Information System Design IT60105
Sequence Diagrams Sequence; Interaction Diagrams Behavioral Diagrams
Use Case Driven Analysis Requirements Use Case Use Case Description System Sequence Diagram Chapter 5.
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 5 INTRODUCTION TO SYSTEMS ANALYSIS AND DESIGN: AN AGILE, ITERATIVE APPROACH CHAPTER.
CSCI-383 Object-Oriented Programming & Design Lecture 12.
Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.
States.
UML: State Chart Diagrams
State Chart diagram Week objective Describe State chart Diagrams in Dynamic Modelling 2.
Information Systems Engineering Activity Diagram 1.
Zhang Shuang Software Engineering Zhang Shuang 1.
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.
Chapter 7 Behavioral Modeling Brandon A. Jones Stand and Deliver ITEC March 6, 2011.
March 2007ACS-3913 R. McFadyen1 UML Statechart Diagram A UML Statechart Diagram describes states for an object how/why an objects’ state changes A Statechart.
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 transition modeling
ATM OO Design and Implementation Case Study
State Machine Model.
Dynamic Modeling of Banking System Case Study - I
Activity and State Transition Diagram
State Machine Diagrams
Use Case Modeling - techniques for detailing use cases
UML State machine diagram
States.
Object Oriented System Design
Chapter 10 Object States and The Statechart Diagram
States.
Information Systems Engineering
UML State Diagrams.
Presentation transcript:

March R. McFadyen1 Statechart Diagram A Statechart Diagram describes states for an object how/why an objects’ state changes A Statechart Diagram is a State Machine A State Diagram models an object’s decision about what it does when it receives a message Reference: Ch 12 UML

March R. McFadyen2 States, Events, Transitions State - a condition or situation during the life of an object during which it satisfies some condition, performs some activity, or waits for some event. Event - a noteworthy occurrence An event can trigger a state transition Transition – a relationship between two states indicating that an object in the first state will perform certain actions and enter the second state when a specified event occurs and specified conditions are satisfied

March R. McFadyen3 State Machine State Machine - a specification of the sequences of states that an object goes through in response to events during its life A State Machine is a graph of states and transitions that describes the response of an instance of a classifier to the receipt of events State Machines may be attached to classes, use cases,...

March R. McFadyen4 State Diagram - General Form state1state2 event [guard] /action initial state We choose to represent events that suit us - enabling a diagram to represent the level of detail we need final state

March R. McFadyen5 Library Book Example Now consider a class Book. Suppose there may be several copies of the book. Here, we’ll model the states Borrowable, and Not borrowable. Not borrowableBorrowable returned borrowed[last copy] returned borrowed[not last copy]

March R. McFadyen6 Library Book Example Not borrowableBorrowable returned borrowed[last copy] returned borrowed[not last copy] Note: when a Book receives the returned event, the next state depends only on the current state when a Book receives the borrowed event, the next state is determined by the guard

March R. McFadyen7 Selling Seats Example availablefull Consider a situation where tickets are being sold for a voyage. Tickets can be sold as long as there are seats available. At some point, all seats could have been sold and the voyage is full. Eventually, sales are closed and no more seats can be sold. We’ll consider states full and available for a voyage. Seat sold [not last one] Seat sold [last one] Sales closed

March R. McFadyen8 active Four States: active overdrawn closed deleted overdrawn deletedclosed Bank Account Example We’ll develop the example by considering each state, and the transitions that can occur when an account is in that state.

March R. McFadyen9 active trx [pos] overdrawn trx [neg]/warn() closed close An account begins by being Active. Once in the Active state, the account can remain active, become overdrawn, or be closed. {trx stands for “transaction” which represents a deposit or withdrawal} Bank Account Example

March R. McFadyen10 activeoverdrawn trx[pos] trx [neg]/warn() close /warn() From the Overdrawn state, an account can remain overdrawn, or move to the active state Bank Account Example [pos] is a guard that stands for “the account balance is positive” [neg] …

March R. McFadyen11 deleted delete closed From the Closed state, an account can move to the Deleted state; it can also be made active again. Deleted is considered the final state for an account reopen active Bank Account Example

March R. McFadyen12 active trx [pos] overdrawn trx [neg]/warn() deleted delete closed close trx [pos] trx [neg]/warn() close /warn() reopen All together: Bank Account Example