Software Engineering 1 Object-oriented Analysis and Design Chap 29 UML State Machine Diagrams and Modeling.

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

Chapter 29 State Machine Diagrams Sate Machine Diagrams Represent state of an object Behavior as reaction to events.
UML State Machine Diagrams and Modeling
Object Design Examples with GRASP
ZEIT2301 Design of Information Systems Behavioural Design: State Machines School of Engineering and Information Technology Dr Kathryn Merrick.
© 2006 ITT Educational Services Inc. SE350 System Analysis for Software Engineers: Unit 9 Slide 1 Appendix 3 Object-Oriented Analysis and Design.
Jan 15, Ron McFadyen1 Ch 9. Use-case model: drawing System Sequence Diagrams Iteration: a simple cash-only success scenario of Process Sale.
Jan Ron McFadyen1 Consider a simple cash-only Process Sale scenario 1. Customer arrives at a POS checkout with goods and/or services to purchase.
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 5, Analysis: Dynamic Modeling.
January Ron McFadyen1 Ch 9. Use-case model: drawing System Sequence Diagrams Elaboration Iteration 1: a simple cash-only success scenario of.
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.
Object-Oriented Analysis and Design
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.
University of Toronto Department of Computer Science © Steve Easterbrook. This presentation is available free for non-commercial use with attribution.
Activity Diagrams and State Charts for detailed modeling Larman, chapters 28 and 29 CSE 432: Object-Oriented Software Engineering Glenn D. Blank.
Unified Modeling Language
Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative Development Part III Elaboration Iteration I – Basic1.
State and Sequence Diagrams Modelling dynamic information So far we have seen: Use Case Diagrams – requirements capture, interface.
Chapter 5 – System Modeling
Chapter 5 – System Modeling
Chapter 10 State Machine Diagrams
UML Collaboration Diagram. Recap System Sequence Diagrams (SSD) UML for SSD Examples.
Software Engineering 1 Object-oriented Analysis and Design Chap 30 Relating Use Cases.
1 Object-Oriented Modeling Using UML (2) CS 3331 Fall 2009.
NJIT Modeling Behavior in State Chart Diagrams Chapter 29 Rafael Mello.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
Object Design Examples with GRASP (Ch. 18)
Behavioral diagrams Lecture p4 T120B pavasario sem.
Object-Oriented Modeling Using UML CS 3331 Section 2.3 of Jia 2003.
Review ♦ System sequence diagram ♦ Domain model
1 Modeling interactions and behavior Lecturer Dr. Mai Fadel.
Session 22 Modeling the Extended Features of the Statechart Written by Thomas A. Pender Published by Wiley Publishing, Inc. October 27, 2011 Presented.
Chapter 5 System Modeling (2/2) Yonsei University 2 nd Semester, 2014 Sanghyun Park.
Chap 28 UML Activity Diagrams and Modeling
What to remember from Chap 13 (Logical architecture)
Discovering object interaction. Use case realisation The USE CASE diagram presents an outside view of the system. The functionality of the use case is.
OO Methodology Elaboration Iteration 3 – Part 2 Refining Models.
Course Instructor: Kashif Ihsan 1. Chapter # 3 2.
Information System Design IT60105
COMP-350 Object-Oriented Analysis and Design Drawing System Sequence Diagrams Reference: Larman, Chapter 9.
University of Utah SoCCS Lecture 121 Dynamic Models in Design CS6961 – Lecture 12 Nathan Dykman.
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.
Chapter 29 State Machine Diagrams 1CS6359 Fall 2011 John Cole.
UML Discussion on State Machines Perfectly static system is intensely uninteresting Because nothing ever happens.
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.
Dynamic Modeling Grady Booch, James Rumbaugh, and Ivar Jacobson, The Unified Modeling Language User Guide, 2 nd edition, Addison Wesley, 2005.
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.
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 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.
Dr. Awais Majeed Object Oriented Design and UML.
TK2023 Object-Oriented Software Engineering CHAPTER 11 CLASS DIAGRAMS.
More on UML 1. 1.Use-case diagram 2.Class diagram [Object diagram] (static) 1.1 Domain/analysis model – of reality 1.2 Design model – of decisions 3.
Chapter 5 – System Modeling Lecture 1 1Chapter 5 System modeling.
Chapter 5 System modeling
State Machine Diagram.
DESIGN MODEL: USE-CASE REALIZATIONS WITH GRASP PATTERNS
State Machine Diagrams
CS251 – Software Engineering Lectures 11 State Diagrams
States.
States.
State Machine Diagrams
Modeling Behavior in Statechart Diagrams
UML State Diagrams (Ch. 29)
Presentation transcript:

Software Engineering 1 Object-oriented Analysis and Design Chap 29 UML State Machine Diagrams and Modeling

Software Engineering 2 Object-oriented Analysis and Design State Machine Diagram 1  State machine diagram m shows the lifecycle of an object: what events it experiences, its transitions, and the states it is in between these events. m It need not illustrate every possible event. m Transitions are shown as arrows, labeled with their event. m States are shown in rounded rectangles. m initial pseudo-state automatically transitions to another state when the instance is created.

Software Engineering 3 Object-oriented Analysis and Design State Machine Diagram 2 off hook IdleActive on hook Telephone state transitionevent initial state

Software Engineering 4 Object-oriented Analysis and Design Events, States, and Transitions  An event is a significant or noteworthy occurrence.event m A telephone receiver is taken off the hook.  A state is the condition of an object at a moment in time between events.state m A telephone is in the state of being "idle" after the receiver is placed on the hook and until it is taken off the hook.  A transition is a relationship between two statestransition m indicates that when an event occurs, the object moves from the prior state to the subsequent state. m e.g. When the event "off hook" occurs, transition the telephone from the "idle" to "active" state.

Software Engineering 5 Object-oriented Analysis and Design Transition Actions and Guards  A transition can cause an action to fire. m this may be implemented as the invocation of a method of the class.  A transition may also have a conditional guard or boolean test. m The transition only occurs if the test passes. Idle on hook Active transition action guard condition [valid subscriber] off hook /play dial tone

Software Engineering 6 Object-oriented Analysis and Design Apply State Machine Diagrams 1  State-Independent Objects (modeless) m always responds the same way to an event.  State-dependent objects m react differently to events depending on their state or mode.  Guideline m state machines for state-dependent objects with complex behavior. m The phone's reaction to pushing a particular button (generating an event) depends on the current mode of the phone off hook, engaged.  Guideline m business information systems have few complex state-dependent classes. It is seldom helpful to apply state machine modeling. m process control, device control, protocol handlers, and telecommunication domains have many state-dependent objects.

Software Engineering 7 Object-oriented Analysis and Design Apply State Machine Diagrams 2  To model the behavior of a complex reactive object in response to events. m Physical Devices controlled by software: Phone, car, microwave oven. They have complex and rich reactions to events, and the reaction depends upon their current mode. m Transactions and related Business Objects: a sale, order, payment. For example, what should happen to an Order if a cancel event occurs?  understanding all the events and states that a Package can go through in the shipping business can help with design, validation, and process improvement. m Role Mutators (objects change their role): A Person changing roles from being a civilian to a veteran. Each role is represented by a state.

Software Engineering 8 Object-oriented Analysis and Design Apply State Machine Diagrams 3  To model legal sequences of operations protocol or language specifications. m Communication Protocols: TCP, and new protocols  The diagram illustrates when operations are legal.  a TCP "close" request should be ignored if the protocol handler is already in the "closed" state. m UI Page/Window Flow or Navigation  to understand the legal sequence between Web pages or windows; this is often complex. m UI Flow Controllers or Sessions  This is related to UI navigation modeling, but specifically focused on the server-side object that controls page flow.  These are usually server-side objects representing an ongoing session or conversations with a client.  e.g., a Web application that remembers the state of the session with a Web client and controls the transitions to new Web pages, or the modified display of the current Web page, based upon the state of the session and the next operation that is received.

Software Engineering 9 Object-oriented Analysis and Design Apply State Machine Diagrams 3  To model legal sequences of operations protocol or language specifications. m Use Case System Operations  System operations for Process Sale: makeNewSale, enterItem, should arrive in a legal order;  e.g., endSale should come after one or more enterItem operations. If the order is complex, a state machine can model this, treating the use case itself as an object. m Individual UI Window Event Handling  Understanding the events and legal sequences for one window or form.  e.g., the Edit-Paste action is only valid if there is something in the "clipboard" to paste.

Software Engineering 10 Object-oriented Analysis and Design Nested States  A state allows nesting to contain substates; a substate inherits the transitions of its superstate m it leads to succinct state machine diagrams. m e.g., when a transition to the Active state occurs, creation and transition into the PlayingDialTone substate occurs. No matter what substate the object is in, if the on hook event related to the Active superstate occurs, a transition to the Idle state occurs. Idle Off hook/play dial tone Active [valid subscriber] PlayingDialTone Dialing Connecting digit complete Talking connected On hook

Software Engineering 11 Object-oriented Analysis and Design UI Navigation Modeling with State Machines  Some (Web) UI applications have complex page flows. m State machines are a great way to to model page flows, during creative design. m The states represent the pages and the events represent the events that cause transfer from one page to another, such as a button click.

Software Engineering 12 Object-oriented Analysis and Design NextGen POS State Machine Diagram

Software Engineering 13 Object-oriented Analysis and Design State Machine Diagrams in the UP  There is not one model in the UP called the "state model." m Any element in any model (Design Model, Domain Model, Business Object Model) may have a state machine to better understand or communicate its dynamic behavior m e.g., a state machine associated with the Sale design class of the Design Model is itself part of the Design Model