Advanced Behavioral Modeling

Slides:



Advertisements
Similar presentations
© 2005 by Prentice Hall Appendix 3 Object-Oriented Analysis and Design Modern Systems Analysis and Design Fourth Edition Jeffrey A. Hoffer Joey F. George.
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.
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.
1 CS 691z/791z Topics in Software Engineering Chapter 20: Advanced Statechart Modeling [Arlow and Neustadt, 2002] March 8, 2007.
1 © Wolfgang Pelz UML2 UML Part 3. 2 © Wolfgang Pelz UML2 Chapter Ten State Machine Diagrams.
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.
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
(C) 2009 J. M. Garrido1 Object Oriented Simulation with Java.
מידול התנהגותי 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.
Chapter 5 Implementing UML Specification (Part II) Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence.
Behavioral diagrams Lecture p4 T120B pavasario sem.
Object-Oriented Modeling Using UML CS 3331 Section 2.3 of Jia 2003.
1 Interaction diagrams and activity diagrams Speaker: 陳 奕 全 Real-time and Embedded System Lab 15 August 2002.
Sequence & Statechart Diagrams Month Day, Year. Agenda Training Plan Overview Actors and Use Case Diagrams Sequence Diagrams Diagram Elements Evolution.
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.
Information System Design IT60105
Software Engineering Design & Modeling Statechart Diagram.
Chapter 5 Implementing UML Specification (Part II) Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence.
1 Kyung Hee University Statecharts Spring Kyung Hee University Specifying Objects’ Behaviour  Interaction diagrams show message-passing behaviour.
UML Discussion on State Machines Perfectly static system is intensely uninteresting Because nothing ever happens.
Unified Modeling Language User Guide Section 4 - Basic Behavioral Modeling Chapter 19 – Activity Diagrams.
Dynamic Models. Outline Dynamic Models Statecharts –States –Transitions –Composite states Interaction Diagrams –Sequence Diagrams The time order of interactions.
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.
States.
CS3773 Software Engineering Lecture 06 UML State Machines.
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 3rd Edition Copyright © 2009 John Wiley & Sons, Inc. All rights.
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.
Diagrams. Typically, we view the static parts of a system using one of the four following diagrams. 1. Class diagram 2. Object diagram 3. Component diagram.
Test Generation from UML Specifications Michael A. Gray American University Washington, DC.
® 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
UML Chapter 17.
CHAPTER
State Machine Diagrams
Business System Development
UML Activity Diagrams & State Charts
UML State machine diagram
States.
Object Oriented System Design
CS/CPE 426 Senior Projects
Advanced State Chart diagrams
Unified Modeling Language
CS/CPE 426 Senior Projects
States.
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
CS 791Z State Machines & Advanced State Machines
UML State Diagrams.
Appendix 3 Object-Oriented Analysis and Design
Modeling Behavior in Statechart Diagrams
Presentation transcript:

Advanced Behavioral Modeling

Plan of Talk State Machine Statechart Diagrams

State Machines Interaction Diagrams – Society of Objects State Machine – Individual object It specifies life time of instances of class, use case or an entire system Events corresponds to signal, operation or passing of time Activity – nonatomic execution Action – executable atomic computation Visualization of State Machines Activity Diagrams Statechart Diagrams

Usage of State Machines When one object is acted on other object by a synchronous operation call, they do not need state machine to specify their behavior They apply to objects that must respond to signals, which are asynchronous stimuli communicated between instances Ultimately The behavior of objects that must respond to asynchronous stimulus Or whose current behavior depends on their past is best specified by using a state machine

Terms Usage – To model the behavior of use case, interface State situation during the life of an object during which it satisfies some condition, performs some activity, or waits for some event Its Parts- Name entry/exit actions Internal Transitions Substates Deferred events What are pseudostates?

Terms

Terms Transitions relationship between two states On such a change of state, the transition is said to fire from source state to target state Parts Source state Event trigger Guard condition Action Target state

Terms Advanced State and Transitions Entry actions- No matter which transition led you there Exit actions- No matter which transition led you away Internal transitions- the event is handled without dispatching the state's exit and then entry actions. Activities- Ongoing work in state Deferred events-want to recognize some events but postpone a response to them by queuing the events

State MACHINE S T U D E N O B J C

Substates Validating and Processing are called sequential, It is a state that's nested inside another one A state that has substates that is, nested states is called a composite state. A nested sequential state machine may have at most one initial state and one final state. Validating and Processing are called sequential, or disjoint, substates.

Substates Dialing a number on a telephone Line

History substate To remember the last substate that was active prior to leaving the composite state e.g. unattended backup of computers H designates a shallow history, which remembers only the history of the immediate nested state machine. deep history denoted as H* remembers the innermost nested state at any depth If nested state machine reaches a final state, it loses its stored history

History substate

Concurrent Substates Allows to specify two or more state machines that execute in parallel in the context of the enclosing object OR model concurrency is by using active objects Each Concurrent Substates further decomposed into sequential substates

Concurrent Substates

Statechart Diagrams A statechart diagram shows a state machine An activity diagram is a special case of a statechart diagram in which all or most of the states are activity states and all or most of the transitions are triggered by completion of activities in the source state Statechart Diagram shows flow of control from state to state This involves modeling the behavior of reactive objects Reactive object - is one whose behavior is best characterized by its response to events dispatched from outside its context

Statechart Diagrams

Elements of Statechart Diagram Simple states Composite states Transitions including events and actions A statechart diagram may contain any and all features of a state machine

Usage To model the dynamic aspects of a system, a class, or a use case To model reactive objects or event-driven object It is typically idle until it receives an event The behavior can be specified by the stable states in which that object may live the events that trigger a transition from state to state The actions that occur on each state change These events may also be trigger self- and internal transitions

To model reactive object Choose the context for the state machine, whether it is a class, a use case, or the system as a whole Choose the initial and final states for the object. To guide the rest of your model, possibly state the pre- and postconditions of the initial and final states, respectively. Decide on the stable states of the object by considering the conditions in which the object may exist for some identifiable period of time. Decide on the meaningful partial ordering of stable states over the lifetime of the object Decide on the events that may trigger a transition from state to state. Model these events as triggers to transitions that move from one legal ordering of states to another.

To model reactive object Attach actions to these transitions (as in a Mealy machine) and/or to these states (as in a Moore machine) Consider ways to simplify your machine by using substates, branches, forks, joins, and history states. Check that all states are reachable under some combination of events Check that no state is a dead end from which no combination of events will transition the object out of that state. Trace through the state machine, either manually or by using tools, to check it against expected sequences of events and their responses.

Parsers that stream in and stream out meassages to XML Statechart diagram for parsing a simple context-free language, message : '<'string '>'string ';'

Forward and Reverse Engineering It is possible especially if the context of the diagram is a class. Using the previous statechart diagram, a forward engineering tool could generate the Java code for the class ‘X’ The forward engineering tool must generate the necessary private attributes and final static constants Reverse Engineering is not possible but it allows animation of a model against the execution of a deployed system