States.

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.
State Charts Mehran Najafi. Reactive Systems A reactive, event-driven, object is one whose behavior is best characterized by its response to events dispatched.
Behavioral Modeling: State Diagrams CIS 4800 Kannan Mohan Department of CIS Zicklin School of Business, Baruch College Copyright © 2009 John Wiley & Sons,
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
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.
1 Behavioral Modeling Chapter 8. 2 Key Ideas Behavioral models describe the internal dynamic aspects of an information system that supports business processes.
Introduction to Software Engineering 7. Modeling Behaviour.
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.
5/24/2015CPSC , CPSC , Lecture 71 Software Engineering, CPSC , CPSC , Lecture 7.
1 CS 691z/791z Topics in Software Engineering Chapter 13: Activity Diagrams & Chapter 19: Basic Statecharts [Arlow and Neustadt, 2002] March 8, 2007.
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.
1 CS 691z/791z Topics in Software Engineering Chapter 20: Advanced Statechart Modeling [Arlow and Neustadt, 2002] March 8, 2007.
THE OBJECT-ORIENTED DESIGN WORKFLOW Statechart Diagrams.
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.
CS451 Introduction to Software Engineering Behavioral Modeling.
Lecture 4 Finite State Machine CS6133 Software Specification and Verification.
Chapter 10 State Machine Diagrams
מידול התנהגותי 1. Today’s Session Sequence Diagrams State Machines 2.
1 Object-Oriented Modeling Using UML (2) CS 3331 Fall 2009.
Business Informatics Group Institute of Software Technology and Interactive Systems Vienna University of Technology Favoritenstraße 9-11/188-3, 1040 Vienna,
NJIT Modeling Behavior in State Chart Diagrams Chapter 29 Rafael Mello.
1 Software Engineering Dr. K. T. Tsang Lecture 8 State modeling
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.
Sequence & Statechart Diagrams Month Day, Year. Agenda Training Plan Overview Actors and Use Case Diagrams Sequence Diagrams Diagram Elements Evolution.
UML -Part 3. Dynamic Diagram Types Interaction Diagrams - Set of objects or roles and the messages that can be passed among them. – Sequence Diagrams.
CSIS3600 System Analysis and Design Statechart Diagrams.
Information System Design IT60105
Software Engineering Design & Modeling Statechart Diagram.
1 Kyung Hee University Statecharts Spring Kyung Hee University Specifying Objects’ Behaviour  Interaction diagrams show message-passing behaviour.
State Modeling. Introduction A state model describes the sequences of operations that occur in response to external stimuli. As opposed to what the operations.
Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.
OMT Modeling 1. Object Model : presented by the object model and the data dictionary. 2. Dynamic Model: presented by the state diagrams and event flow.
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 UML State Diagrams.
CS3773 Software Engineering Lecture 06 UML State Machines.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 26. Review UML behavioral Diagrams – Sequence diagram.
 Engineering Quality Software.  Today o State Diagrams Jerry Kotuba SYST30009-Engineering Quality Software 2.
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.
2/25/2016COSC , Lecture 191 Real-Time Systems, COSC , Lecture 19 Stefan Andrei.
1 7 Systems Analysis and Design in a Changing World, 2 nd Edition, Satzinger, Jackson, & Burd Chapter 7 The Object-Oriented Approach to Requirements.
Test Generation from UML Specifications Michael A. Gray American University Washington, DC.
State Modeling. Introduction A state model describes the sequences of operations that occur in response to external stimuli. As opposed to what the operations.
® IBM Software Group © 2009 IBM Corporation Module 11: Creating State Machine Diagrams Essentials of Modeling with IBM Rational Software Architect V7.5.
UML Review: State Machines. Sept. 17, 2003Lecture 5: CS660 Fall Overview States Transitions Activities Modeling object lifeline Creating well-structured.
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 Advanced UML State Diagrams.
State transition modeling
State Machine Model.
State Machine Diagram.
State Machine Diagrams
Dynamic Modeling of Banking System Case Study - I
Activity and State Transition Diagram
State Machine Diagrams
UML State Diagrams.
CSC 422 Kutztown University Dr. Spiegel
UML State machine diagram
States.
Object Oriented System Design
Advanced State Chart diagrams
Chapter 5 state Modeling
States.
UML State Diagrams.
Modeling Behavior in Statechart Diagrams
Copyright © 2015, 2012, 2009 Elsevier Inc. All rights reserved.
UML State Diagrams (Ch. 29)
Presentation transcript:

States

Introduction A state machine … Models the behavior of an individual object (statechart diagram) or a society of objects (activity diagram). Is a dynamic model of the system. Is event driven. Events trigger activities which, in turn, trigger actions. Actions are atomic. Actions may cause the return of a value or the change of state of an object. State machines come in two varieties: Activity diagrams. Statechart diagrams.

Introduction

Terms and Concepts States A state is a condition or situation during the life of an object in which it satisfies some condition, performs some activity, or waits for some event. A state may include … Name Entry/exit actions Internal transitions Activities Substates - may sequential or concurrent Deferred events (infrequently used)

Terms and Concepts States Special categories of states Initial state - indicates the initial starting state for for the state machine or a substate. Final state - indicates the state machine’s execution has completed. Real-time state machines frequently do not include a final state. Neither initial or final states contain any of the parts found in traditional states.

Terms and Concepts

Terms and Concepts Transition A directed relationship between two states. A flow of control through a statechart diagram. Contains five parts Source state - current state before transition fires. Event trigger - external stimulus that has the potential to cause a transition to fire. Guard condition - a condition that must be satisfied before a transition can fire. Action - an executable atomic computation. Target state - new state after transition fires.

Terms and Concepts

Terms and Concepts Advanced States and Transitions Entry action - Upon each entry to a state, a specified action is automatically executed. Syntax (to be placed inside the state symbol): entry / action Exit action - Just prior to leaving a state, a specified action is automatically executed. Syntax (to be placed inside the state symbol): exit / action

Terms and Concepts Advanced States and Transitions Internal Transitions - The handling of an event without leaving the current state. Used to avoid a states entry and exit actions. Syntax (to be placed inside the state symbol): event / action Activities - Ongoing work that an object performs while in a particular state. The work automatically terminates when the state is exited. Syntax (to be placed inside the state symbol): do / activity Activities are ongoing operations; actions are instantaneous operations.

Terms and Concepts

Terms and Concepts Advanced States and Transitions Deferred Event - An event whose occurrence is responded to at a later time. Syntax (to be placed inside the state symbol): event / defer Once an event has been deferred it remains deferred until a state is entered where that particular type of event is not listed as deferred. The state diagram then responds to the event as if it had just occurred.

Terms and Concepts Advanced States and Transitions Simple state - A state that contains no substates. Composite state - A state that contains substates. Substate - A state that is nested inside another state. Substates allow state diagrams to show different levels of abstraction. Substates may be sequential or concurrent. Substates may be nested to any level.

Terms and Concepts Advanced States and Transitions Sequential Substates - The most common type of substate. Essentially, a state diagram within a single state. The “containing” state becomes an abstract state. The use of substates simplifies state diagrams by reducing the number of transition lines. A nested sequential state diagram may have at most one initial state and one final state.

Terms and Concepts

Terms and Concepts Advanced States and Transitions History States - Allows an object to remember which substate was last active when the containing state was exited. Upon re-entry to the containing state, the substate that was last active will be re-entered directly.

Terms and Concepts Advanced States and Transitions Concurrent Substates - Used when two or more state diagrams are executing concurrently within a single object. Allows an object to be in multiple states simultaneously. The concurrent state diagrams within a “containing” state must begin and end execution simultaneously. If one concurrent state diagram finishes first, it must wait for the others to complete before exiting the containing state.

Terms and Concepts

Concurrent State Diagrams Using OMT Notation

State Diagram for a Phone Line

Event Trace for an ATM Transaction

State Diagrams ATM, Bank, and Consortium

Statechart Diagrams

Introduction A statechart diagram, also known as state diagram, models the dynamic aspects of the system by showing the flow of control from state to state for a particular class. Every class will have its own statechart diagram. In practice, only classes with interesting or complex internal behavior will be modeled with statechart diagrams. Statechart diagrams are not shared among classes.

Introduction Whereas an activity diagram models the flow of control from activity to activity, a statechart diagram models the flow of control from event to event. Statechart diagrams show how an object reacts to external events or conditions during the course of its lifetime.

Terms and Concepts State Transition A state is a condition or situation during the life of an object in which it satisfies some condition, performs some activity, or waits for some event. Transition A transition is a relationship between two states indicating that an object in the first state will perform certain actions and enter the second state when certain events and conditions have occurred.

Terms and Concepts Event Activity Action An event is the specification of a significant occurrence that has a location in time and space. Activity An activity is an ongoing non-atomic execution within a state machine. Action An action is an atomic execution within a state machine that results in a change of state or the return of a value.

Terms and Concepts