State and Sequence Diagrams Modelling dynamic information So far we have seen: Use Case Diagrams – requirements capture, interface.

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

Concepts & Notations. Acknowledgements  The material in this tutorial is based in part on: Concurrency: State Models & Java Programming, by Jeff Magee.
Behavioral Modeling: State Diagrams CIS 4800 Kannan Mohan Department of CIS Zicklin School of Business, Baruch College Copyright © 2009 John Wiley & Sons,
ESE Einführung in Software Engineering 7. Modeling Behaviour Prof. O. Nierstrasz.
UML (Sequence Diagrams, Collaboration and State Chart Diagrams) Presentation By - SANDEEP REDDY CHEEDEPUDI (Student No: ) - VISHNU CHANDRADAS (Student.
ZEIT2301 Design of Information Systems Behavioural Design: State Machines School of Engineering and Information Technology Dr Kathryn Merrick.
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.
Software Engineering COMP 201
1 © Wolfgang Pelz UML2 UML Part Two. 2 © Wolfgang Pelz UML2 Chapters Four & Twelve Interaction Diagrams.
Essentials of interaction diagrams Lecture 23 & 24.
Chapter 8: Modelling Interactions and Behaviour
Essentials of state and activity diagram Lecture 24.
State Machine Diagrams (State Chart in UML 1) Specifying Control (ref: Chapter 11 Bennett, Mc Robb and Farmer)
Sequence Diagram. What is Sequence Diagram?  Sequence Diagram is a dynamic model of a use case, showing the interaction among classes during a specified.
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.
UML Sequence Diagrams Eileen Kraemer CSE 335 Michigan State University.
Modern Systems Analysis and Design Fifth Edition Jeffrey A
Object-Oriented Analysis and Design: Sequence Diagrams
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.
An Introduction to Rational Rose Real-Time
UML Sequence Diagrams Michael L. Collard, Ph.D. Department of Computer Science Kent State University.
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
CS3773 Software Engineering
UML Collaboration Diagram. Recap System Sequence Diagrams (SSD) UML for SSD Examples.
Class, Sequence and UML Model.  Has actors and use cases.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
Interaction diagrams Sequence and collaboration diagrams.
State diagrams Interaction diagrams –Sequence diagrams –Collaboration diagrams Object orientation Part 4: Dynamic Modeling.
High-Level Design With Sequence Diagrams COMP314 (based on original slides by Mark Hall)
1 Modeling interactions and behavior Lecturer Dr. Mai Fadel.
ניתוח מערכות מידע 1 Unified Modeling Language (UML) § § The Unified Modeling Language (UML) is the industry-standard language for: Specifying, Visualizing,
Discovering object interaction. Use case realisation The USE CASE diagram presents an outside view of the system. The functionality of the use case is.
Course Instructor: Kashif Ihsan 1. Chapter # 3 2.
Object-Oriented Analysis and Design 1 Mira Balaban & Arnon Sturm Object-Oriented Analysis and Design Session 3a: Behavioral Modeling - Interactions.
Object Oriented Analysis and Design Sequence Diagrams.
1 Kyung Hee University Diagram Editor : Design View Spring 2001.
CSCI-383 Object-Oriented Programming & Design Lecture 12.
Chapter 11 Activity Diagrams. 2 “Activity diagrams are a technique to describe procedural logic, business processes, and work flows” - M. Fowler An activity.
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.
Dynamic Models Sequence Diagrams Collaboration Diagrams Activity Diagrams.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 26. Review UML behavioral Diagrams – Sequence diagram.
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.
 The Sequence Diagram models the collaboration of objects based on a time sequence.  It shows how the objects interact with others in a particular scenario.
Appendix Object-Oriented Analysis and Design: Use Cases and Sequence Diagrams Modern Systems Analysis and Design Fifth Edition Jeffrey A. Hoffer Joey F.
ITEC1301 Object-Oriented Systems Construction Lecture Notes #4 1.
Project 2: Phase 1 Submission 7 Late submissions 10% 10 No submissions 14% Better than project 1 phase 3 submissions 10-point bonus: If you catch the deadline.
Sequence diagrams Lecture 5. Main terms  Interaction  Life line  Activation  Executable behavior and derived behavior  Messages  Trajectory  Frame.
State Modeling. Introduction A state model describes the sequences of operations that occur in response to external stimuli. As opposed to what the operations.
Appendix 3 Object-Oriented Analysis and Design
State Machine Model.
State Machine Diagrams
Sequence Diagram.
Object-Oriented Analysis and Design: Sequence Diagrams
State Machine Diagrams
Business System Development
UML dynamic Modeling (Behavior Diagram)
Princess Nourah bint Abdulrahman University
Object Oriented Analysis and Design
Princess Nourah bint Abdulrahman University
Object Oriented System Design
BPMN - Business Process Modeling Notations
Appendix 3 Object-Oriented Analysis and Design
Presentation transcript:

State and Sequence Diagrams Modelling dynamic information So far we have seen: Use Case Diagrams – requirements capture, interface modelling Use Case Scripts – more detailed and with alternate, less common cases noted Class Diagrams – description of the structure of a class and possibly its relationship with other classes These are static descriptions of software

State and Sequence Diagrams Dynamic Modelling In order to model the dynamic (run-time) relationships we need different tools The UML provides us with State Diagrams and Object Sequence Diagrams (OSD)‏ There are others...

State and Sequence Diagrams State Diagrams What do state diagrams describe? When things happen The life-cycle of an instance (object)‏ How useful are they? Often but not always used Logically links a Class Diagram to a State Diagram – events are operations on classes in the Class Diagram Clarifies the internal state and external behaviour of an object

State and Sequence Diagrams State Diagram Elements start pointstatesend point(s) transitions (labeled with events)‏

State and Sequence Diagrams State Diagram examples A chess game class White takes the first turn, then turns alternate After any move “mate” or “stalemate” may occur

State and Sequence Diagrams State Change Events A state describes a particular condition of an object for a period of time – it waits for an event to change state or to “fire” Events can be of the following types: Change – occurs when a condition becomes true i.e. a boolean Call/Signal – occurs when an object receives a call for one of its operations (from another object or from itself)‏ Time trigger

State and Sequence Diagrams Guards Known as a guard condition It guards the transition i.e. the transition can only take place if the guard condition evaluates to true Guards are constraints on behaviour Example in Visio

State and Sequence Diagrams Event Types Kinds of events receipt of a call on an operation - a message receipt of an explicit signal from another object - a message a condition becoming true passage of a designated period of time Basic semantics about event labelled transitions events are triggers that activate state transitions if an event occurs and guard is false then the event is ignored (events are not stored)‏

State and Sequence Diagrams Visio Support – State Chart

State and Sequence Diagrams Inside States Three kinds of internal content for a state These represent the internal activities or state activities that are executed in that state Entry actions Exit actions Internal transitions - do not cause a state change All the above represent the operations for the class that is being modelled

State and Sequence Diagrams How to find States A state chart captures all the possible responses of a single object to all the Use Cases in which it is involved So a cross reference of which of the Use Cases a class is involved in will give you possible states for an object of that class The state chart can be seen as a description of all the possible life-cycles for an object Provides a dynamic view of a class

State and Sequence Diagrams Object Sequence Diagrams OSDs depict a Use Case Script visually but also show the classes (objects) used in the script They show the sequence of object interaction Read the Visio tutorials for detailed information on the Sequence Chart The next slides show example Sequence Charts

State and Sequence Diagrams Simple Example

State and Sequence Diagrams

State and Sequence Diagrams Sequence Diagrams Purpose Captures the behaviour of a single use case - how messages are sent within a use case Shows how objects interact with each other - show how they send and receive messages Focuses on time Syntax Object Time message

State and Sequence Diagrams Sequence Diagram  Example

State and Sequence Diagrams Sequence Diagram Types of messages simple flat flow of control - control is passed without describing any details synchronous nested flow of control - operation call handling of the message is completed before the caller resumes execution asynchronous there is no explicit return to the caller the sender continues to execute after sending the message without waiting for it to be handled

State and Sequence Diagrams Sequence Diagram Activation Time during which object performs an action either directly or through another object (subcontractor)‏ Return Implicit Explicit

State and Sequence Diagrams Drawing an OSD Select a Use Case for which you have a Script Make a list of classes which appear on that script (you may have done this already if you have created a Class Diagram)‏ Use Visio to create a new Sequence Diagram Do the simple things first and build it up Place the objects (classes) on the diagram Think about the order that you put them in

State and Sequence Diagrams Drawing an OSD When creating messages, for the first draft just use the simple message call shape Refine to synchronous or asynchronous at the 2 nd draft Finally, put the rectangle duration box (operation life) overlay onto the timeline for each object Then review it and do a 2 nd draft

State and Sequence Diagrams Self-paced tutorial Create a State Diagram in Visio for the third version of the example Soup Menu application Hints: states include ingredient choice (three types) and action choice What kind of transitions are there? - write down a list Hints: remember that each transition is a flow from one state to another Finally, what events/actions are there for the transitions in your list?