UML Diagrams: StateCharts The Dynamic Analysis Model

Slides:



Advertisements
Similar presentations
Requirements Elicitation and Use Case Diagrams
Advertisements

® IBM Software Group © 2006 IBM Corporation Rational Software France Object-Oriented Analysis and Design with UML2 and Rational Software Modeler 04. Other.
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.
L4-1-S1 UML Overview © M.E. Fayad SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I.
© 2005 Prentice Hall12-1 Stumpf and Teague Object-Oriented Systems Analysis and Design with UML.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 14 Slide 1 Object-oriented design 2.
Software Engineering I Object-Oriented Design
Software Engineering I Object-Oriented Design Software Design Refinement Using Design Patterns Instructor: Dr. Hany H. Ammar Dept. of Computer Science.
THE OBJECT-ORIENTED DESIGN WORKFLOW Statechart Diagrams.
UML Sequence Diagrams Eileen Kraemer CSE 335 Michigan State University.
SOFTWARE DESIGN (SWD) Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
UML Diagrams: Sequence Diagrams The Requirements Model, and The Dynamic Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical.
UML Sequence Diagrams Michael L. Collard, Ph.D. Department of Computer Science Kent State University.
1 Introduction to UML DIAGRAMS & CLASS DIAGRAM Chapter 7,8 主講人 : 許勝杰
UML Diagrams: Sequence Diagrams The Requirements Model, and The Dynamic Analysis Model Prof. Hany H. Ammar, CSEE, WVU, and Dept. of Computer Science, Faculty.
Software Design Refinement Using Design Patterns Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
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.
POAD Distributed System Case Study: A Medical Informatics System Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
Software Design The Dynamic Model Design Sequence Diagrams and Communication Diagrams Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical.
Requirements Modeling and Use Case Diagrams Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
Dynamic Modeling Chapter 11 Part of Analysis Modeling Designing Concurrent, Distributed, and Real-Time Applications with UML Hassan Gomaa (2001)
UML Diagrams: Sequence Diagrams The Requirements Model, and The Dynamic Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical.
Object-Oriented Modeling Using UML CS 3331 Section 2.3 of Jia 2003.
Modeling Shari L. Pfleeger and Joanne M. Atlee, Software Engineering: Theory and Practice, 4 th edition, Prentice Hall, Hans Van Vliet, Software.
The Static Analysis Model Class Diagrams Prof. Hany H. Ammar, CSEE, WVU, and Dept. of Computer Science, Faculty of Computers and Information, Cairo University.
Information System Design IT60105
Software Design Refinement Using Design Patterns Part II The FSM and the StateChart Patterns Instructor: Dr. Hany H. Ammar Dept. of Computer Science and.
Introduction to OOAD and the UML
CS212: Object Oriented Analysis and Design Lecture 34: UML Activity and Collaboration diagram.
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.
Lecture 9-1 : Intro. to UML (Unified Modeling Language)
Week 04 Object Oriented Analysis and Designing. What is a model? A model is quicker and easier to build A model can be used in simulations, to learn more.
DESIGN OF SOFTWARE ARCHITECTURE
UML (Unified Modeling Language)
Prof. Hany H. Ammar, CSEE, WVU, and
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.
DETAILED DESIGN, IMPLEMENTATION AND TESTING Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 6: Restaurant.
The Dynamic Analysis Model StateCharts Prof. Hany H. Ammar, CSEE, WVU, and Dept. of Computer Science, Faculty of Computers and Information, Cairo University.
Object-Oriented Software Engineering CS288 Paul Krause.
Modified from Sommerville’s originalsSoftware Engineering, 7th edition. Chapter 14 Slide 1 Object-Oriented Design.
Systems Analysis and Design in a Changing World, Fourth Edition
Software Design Refinement Using Design Patterns
Instructor: Dr. Hany H. Ammar
UML Diagrams: Class Diagrams The Static Analysis Model
Instructor: Dr. Hany H. Ammar
UML Diagrams By Daniel Damaris Novarianto S..
State Machine Diagram.
Main issues: • What do we want to build • How do we write this down
Dynamic Modeling of Banking System Case Study - I
Dynamic Modeling of Banking System Case Study - II
Static and Dynamic Modeling Using UML
Instructor: Dr. Hany H. Ammar
Chapter 5 – System Modeling
UML Diagrams Jung Woo.
State Machine Diagrams
Finite State Machines and Statecharts
Object Oriented System Design
Unified Modeling Language
Elevator Collaboration Diagram
Finite State Machines and Statecharts
CS310 Software Engineering Dr.Doaa Sami
Dynamic Modeling Lecture # 37.
SOFTWARE DESIGN (SWD) Instructor: Dr. Hany H. Ammar
Introduction to Pattern Oriented Analysis and Design (POAD)
Chapter 22 Object-Oriented Systems Analysis and Design and UML
Introduction to OOAD and the UML
Presentation transcript:

UML Diagrams: StateCharts The Dynamic Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU

outline The Requirements Model and the Analysis model The Analysis Model and the importance Statecharts Finite State Machines and Statecharts StateChart Elements Examples

UML Development - Overview ACTORS USE CASES REQUIREMENTS ELICITATION Time SCENARIOS D Requirements Engineering System/Object SEQUENCE DIAGRAMS A T A ANALYSIS CLASS DIAGRAM(S) ANALYSIS Specify Domain Objects StateChart DIAGRAMs D I OPERATION CONTRACTS C T Architectural Design Include Design Objects I SUBSYSTEM CLASS/ OR COMPONENT DIAGRAMS DESIGN SEQUENCE DIAG. DEPLOYMENT DIAGRAM O N DESIGN DIAGRAMS A Detailed DESIGN R Y Object Design IMPLEMENTATION CHOICES IMPLEMENTATION Activity DIAGRAMS IMPLEMENTATION PROGRAM

The Requirements Model and the Analysis Model Elicitation Process Functional/ Nonfunctional Requirements Use Case Diagrams/ Sequence Diagrams (the system level) The Analysis Process Static Analysis Dynamic Analysis - Class Diagrams - State Diagrams/ Refined Sequence Diagrams (The object level)

The Analysis Model and the Importance of StateCharts StateCharts are particularly important for real-time systems, Control functions are typically activated at specific states of the system StateCharts model the dynamic behavior of an object (with multiple states of behavior) by showing the possible states that the object can be in (idle, busy, waiting for selection, timedout, processing_transactions, etc) In the analysis model a StateChart diagram is needed for each class of domain objects (including the system class) defined in the class diagram that has multiple states of behavior.

Example: StateChart for class Account in an ATM example

Example: StateChart for Class ATM_Controller (The system class) What are the limitations of this Diagram?

Finite State Machines and Statecharts Statechart Graphical representation of finite state machine–States are rounded boxes–Transitions are arcs • Statechart relates events and states of a class of objects •Event –Causes change of state Referred to as state transition •State –A recognizable situation –Exists over an interval of time–Represents an interval between successive events

Finite State Machines (FSMs) and StateCharts (SCs) SCs are graphical representation of FSMs They can depict complex FSMs consisting of a hierarchy of state diagrams SCs consist of states and transitions A state depicts an actual state of behavior that an object can be in during its life time A transition from one state to another is caused by an event (e.g., user input, received a message from another object, etc)

StateChart Rules States of an Object A recognizable situation Exists over an interval of time Represents an interval between successive events Can be a Macro state of a Micro state A Macro State is defined by another StateChart containing Macro and Micro states A Micro state is a primitive state not defined any Further

Example: Digital Sound Recorder User Interface subsystem Class diagram

Example: Digital Sound Recorder StateChart of MenuUserMode class

Events Event–A discrete signal that happens at a point in time –Also known as a stimulus –Has no duration •Two events –May logically depend on each other –E.g, ATM Card inserted before Pin # entered –May be independent of each other (they can occur independently) –E.g., Cancel

Events and Conditions State transition label – Event [Condition] Condition is a Boolean function – Conditions are optional on statecharts – Condition is true for finite period of time When event occurs, condition must be true for state transition to occur.

Example of transition label

Actions Can be defined as state transition label Actions Entry Actions –Event / action(s) –Event [condition] / action(s) Actions –Executed as a result of state transition –Executes instantaneously at state transition –Terminates itself Entry Actions Defined for a given state and executes on entry to this state from any state Exit Actions Defined for a given state and executes on exit from this state to any state

Recall the Class diagrams of the Cruise Control System

Example: Actions and Conditions, Auto Cruise Controller

Activities Activity Examples of activities –Executes for duration of state •Enable Activity on entry to state •Disable Activity on exit from state Examples of activities –Increase Speed •Executes for duration of Accelerating state –Maintain Speed •Executes for duration of Cruising state –Resume Cruising •Executes for duration of Resuming state

Example: StateChart with Activities, Auto Cruise Controller

Example: Entry Actions, execute on the entry to a state after a state transition

Example: Exit Actions

Example: Macro States, Hierarchical StateCharts ATM system

Elevator Collaboration Diagram Display: Display Door: Door 7: Door_Closed=TRUE 11:Door_Closed=TRUE Floor_No_Arrived 6: Open_Door 10:Open_Door 1: state “Idle”, Floor_No_Arrived=1 3: state “Going_Up”, Req_Highest_Floor=7 4: state “Passenger_Loading”, Floor_No_Arrived=7 8: state “Going_Down”, Req_Lowest_Floor=5 9: state “Passenger_Loading”, Floor_No_Arrived=5 12: state “Idle”, Floor_No_Arrived=5 5: Req_Floor=5 Inside_Elevator_Buttons: Inside_Elevator_Buttons Elevator_SW_Sys: Elevator_SW_Sys Floor_No_Arrived 2: Req_Floor=7 Floor_Sensor: Floor_Sensor Central_Station: Central_Station

Scenario of the Collaboration Diagram Idle on Floor 1 Gets request from Floor 7 Going Up to Floor 7 Gets request from inside passenger to Floor 5 Loading on Floor 7 Going Down to Floor 5 Loading on Floor 5 Idle on Floor 5

In_Service Idle Passenger_Loading Out_of_Service Going_Up Going_Down Req_Floor=NULL Elevator_SW_Sys State Diagram Idle Floor_No_Arrived=Req_Floor /Open_Door Passenger_Loading Alarm is off Floor_No_Arrived= Req_Floor /Open_Door Req_Floor!= NULL Floor_No_Arrived > Req_Lowest_Floor && Door-Closed=TRUE Floor_No_Arrived < Req_Highest_Floor && Door-Closed=TRUE Out_of_Service Floor_No_Arrived< Req_Floor Floor_No_Arrived= Req_Floor /Open_Door Floor_No_Arrived> Req_Floor Alarm is on Going_Up Going_Down Floor_No_Arrived < Req_Highest_Floor && Floor_No_Arrived != Req_Floor Floor_No_Arrived > Req_Lowest_Floor && Floor_No_Arrived != Req_Floor