Lecture 18: Object-Oriented Design – Interaction and State Diagrams Anita S. Malik Adapted from Schach (2004) Chapter 12.

Slides:



Advertisements
Similar presentations
Interaction Diagram Notation From Chapter 15 of Craig Larman, Applying UML and Patterns John Dalesandro.
Advertisements

UML (Sequence Diagrams, Collaboration and State Chart Diagrams) Presentation By - SANDEEP REDDY CHEEDEPUDI (Student No: ) - VISHNU CHANDRADAS (Student.
1 Behavioral Modeling Chapter 8. 2 Key Ideas Behavioral models describe the internal dynamic aspects of an information system that supports business processes.
Chapter 6: Behavioral Modeling
© 2006 ITT Educational Services Inc. SE350 System Analysis for Software Engineers: Unit 9 Slide 1 Appendix 3 Object-Oriented Analysis and Design.
Interaction Diagrams Activity Diagram State Machine Diagram
Object-Oriented Analysis and Design
SE 555 Software Requirements & Specification 1 Activity Diagrams.
Introduction to UML Part 2 Behavioral Modeling. Sequence (event) diagram Describes object interaction Typically captures behavior of a single use case.
Slide 1 Systems Analysis & Design CS183 Spring Semester Dr. Jonathan Y. Clark Course Website:
THE OBJECT-ORIENTED DESIGN WORKFLOW UML2 Sequence Diagrams.
L28-S1 Interaction Diagrams 2003 SJSU -- CmpE Advanced Object-Oriented Analysis & Design Dr. M.E. Fayad, Professor Computer Engineering Department, Room.
1 © Wolfgang Pelz UML2 UML Part Two. 2 © Wolfgang Pelz UML2 Chapters Four & Twelve Interaction Diagrams.
1 UML Component and Deployment Diagrams. Models, Views, and Diagrams Use Case Diagrams Use Case Diagrams Use Case Diagrams Scenario Diagrams Scenario.
UML Sequence Diagrams Eileen Kraemer CSE 335 Michigan State University.
Slide 1 Chapter 8 Behavioral Modeling. Slide 2 Key Ideas Behavioral models describe the internal dynamic aspects of an information system that supports.
SE-565 Software System Requirements More UML Diagrams.
Chapter 3 : Software Process and Other Models Juthawut Chantharamalee Curriculum of Computer Science Faculty of Science and Technology, Suan Dusit University.
Unified Modeling Language
Object-Oriented Analysis and Design
UML Sequence Diagrams Michael L. Collard, Ph.D. Department of Computer Science Kent State University.
State and Sequence Diagrams Modelling dynamic information So far we have seen: Use Case Diagrams – requirements capture, interface.
Interactions. 2 Objects communicate with each other by sending messages. Sending a message is another name for a member function call. –Some C++ 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.
程建群 博士(Dr. Jason Cheng) 年03月
Chapter 8: Modelling Interactions and Behaviour UML Activity Diagram
Interaction diagrams Sequence and collaboration diagrams.
1 SAD2 - UML 2 nd Lecture Sequence Diagram and other dynamic views Lecturer: Dr Dimitrios Makris
Copyright 2002 Prentice-Hall, Inc. Chapter 2 Object-Oriented Analysis and Design Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey.
Lecture 14 & 15: Object- Oriented Analysis Anita S. Malik Adapted from Schach (2004) Chapter 12.
1 Interaction diagrams and activity diagrams Speaker: 陳 奕 全 Real-time and Embedded System Lab 15 August 2002.
Computer Science 340 Software Design & Testing UML Sequence Diagrams.
Modeling Shari L. Pfleeger and Joanne M. Atlee, Software Engineering: Theory and Practice, 4 th edition, Prentice Hall, Hans Van Vliet, Software.
Behavioral Modeling Chapter 8.
ניתוח מערכות מידע 1 Unified Modeling Language (UML) § § The Unified Modeling Language (UML) is the industry-standard language for: Specifying, Visualizing,
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2 nd Edition Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
The Unified Modeling Language Part II Omar Meqdadi SE 2730 Lecture 9 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
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.
Dr.Basem Alkazemi
1/26 On-demand Learning Series Software Engineering of Web Application - Object-Oriented Development & UML Hunan University, Software School.
Modeling as a Design Technique Chapter 2 Part 1: Modeling Concepts Object-Oriented Modeling and Design Byung-Hyun Ha
Introduction to UML CS A470. What is UML? Unified Modeling Language –OMG Standard, Object Management Group –Based on work from Booch, Rumbaugh, Jacobson.
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.
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 3rd Edition Copyright © 2009 John Wiley & Sons, Inc. All rights.
1 Unified Modeling Language, Version 2.0 Chapter 2.
Chapter 3: Introducing the UML
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 5th Edition Copyright © 2015 John Wiley & Sons, Inc. All rights.
Fall 2007 Week 9: UML Overview MSIS 670: Object-Oriented Software Engineering.
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.
Chapter 7 Behavioral Modeling Brandon A. Jones Stand and Deliver ITEC March 6, 2011.
ITEC1301 Object-Oriented Systems Construction Lecture Notes #4 1.
PowerPoint Presentation for Dennis, Wixom & Tegarden Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved. Slide 1.
1 Systems Analysis and Design Behavioral Modeling Chapter 8 (Last one before the Midterm!)
Interactions.
Roberta Roth, Alan Dennis, and Barbara Haley Wixom
The Movement To Objects
Main issues: • What do we want to build • How do we write this down
Unified Modeling Language
Behavioral Modeling.
Princess Nourah bint Abdulrahman University
System Sequence Diagrams
Classification of UML Diagrams
Unified Modeling Language
Interaction diagrams.
Interaction diagrams Interaction diagrams are models that describe how groups of objects collaborate in some behavior. Typically, an interaction diagram.
Uml diagrams In ooad.
Chapter 4 Sequence Diagrams
Presentation transcript:

Lecture 18: Object-Oriented Design – Interaction and State Diagrams Anita S. Malik Adapted from Schach (2004) Chapter 12

CS540 Software Design 2Lecture 18 Capturing System Dynamics Class diagrams capture static properties of the system Class diagrams capture static properties of the system responsibilities and (maybe) state for a class responsibilities and (maybe) state for a class associations among classes associations among classes In some/most systems, describing the dynamics is equally important In some/most systems, describing the dynamics is equally important flow of control (what statement gets executed next) flow of control (what statement gets executed next) interactions (what messages get passed around) interactions (what messages get passed around) state transitions (what states is the system in, and what actions cause it to go into the next state) state transitions (what states is the system in, and what actions cause it to go into the next state) Flow charts are the traditional method of describing non-object-oriented programs; object-oriented systems are often better characterized by describing interactions among objects Flow charts are the traditional method of describing non-object-oriented programs; object-oriented systems are often better characterized by describing interactions among objects

CS540 Software Design 3Lecture 18 What are Interaction Diagrams? Interaction diagrams describe how groups of objects collaborate Interaction diagrams describe how groups of objects collaborate Typically an interaction diagram captures the behavior of a single use case Typically an interaction diagram captures the behavior of a single use case shows a number of example objects, and the messages passed between them to realize the use case shows a number of example objects, and the messages passed between them to realize the use case There are two types of Interaction diagrams: There are two types of Interaction diagrams: Sequence diagrams Sequence diagrams Collaboration diagrams Collaboration diagrams

CS540 Software Design 4Lecture 18 Sequence Diagrams One sequence line per object called object lifeline One sequence line per object called object lifeline Lines between objects represent method calls and returns Lines between objects represent method calls and returns Main components of a sequence diagram Main components of a sequence diagram describing a single scenario describing a single scenario representing "typical" objects representing "typical" objects object lifelines object lifelines message passing message passing conditional conditional iterative iterative returns returns The charm The charm works well in a scenario-driven design environment works well in a scenario-driven design environment better characterization of object-oriented systems better characterization of object-oriented systems simple and visually suggestive simple and visually suggestive

CS540 Software Design 5Lecture 18 Step 1. Start with the Use Case Extended scenario for making a reservation (Air Gourmet Case Study) Extended scenario for making a reservation (Air Gourmet Case Study)

CS540 Software Design 6Lecture 18 Step 2. Draw Sequence Diagram Sequence diagram for making a reservation Sequence diagram for making a reservation

CS540 Software Design 7Lecture 18 Collaboration Diagrams In sequence diagrams, time is implicitly represented as going "down the page" In sequence diagrams, time is implicitly represented as going "down the page" object lifelines object lifelines message sequence top to bottom message sequence top to bottom In collaboration diagrams, the collaboration (message passing sequence) shows the passing of time In collaboration diagrams, the collaboration (message passing sequence) shows the passing of time no explicit visual representation of passing time no explicit visual representation of passing time

CS540 Software Design 8Lecture 18 Collaboration Diagram for Air Gourmet Case Study Collaboration diagram for sending and returning a postcard Collaboration diagram for sending and returning a postcard

CS540 Software Design 9Lecture 18 Collaboration Diagrams (summary) Individual objects are icons in the diagram Individual objects are icons in the diagram identified by class name, and possibly an instance name identified by class name, and possibly an instance name Flow of time is tracked by message numbers Flow of time is tracked by message numbers phases of activity are harder to keep track of phases of activity are harder to keep track of Same iteration and conditional constructs Same iteration and conditional constructs More emphasis on the objects and their names More emphasis on the objects and their names

CS540 Software Design 10Lecture 18 State Diagrams Example of an extremely common and general form of system modeling (FSMs, decision processes, control theory, Petri Nets, state charts, etc. etc.) Example of an extremely common and general form of system modeling (FSMs, decision processes, control theory, Petri Nets, state charts, etc. etc.) system can be in some set of states s 1, s 2,... system can be in some set of states s 1, s 2,... there is a designated start state there is a designated start state actions (activities, program steps) cause state changes actions (activities, program steps) cause state changes execution continues until system enters a designated termination state execution continues until system enters a designated termination state

CS540 Software Design 11Lecture 18 UML State Diagrams States are rectangles/nodes States are rectangles/nodes Actions are coarse-grained abstract behaviors Actions are coarse-grained abstract behaviors execution happens within a state until there is a state change execution happens within a state until there is a state change Arcs between states are "guard conditions" (condition that must be true for a transition to the destination state) Arcs between states are "guard conditions" (condition that must be true for a transition to the destination state)

CS540 Software Design 12Lecture 18 State Diagram for Air Gourmet Case Study

CS540 Software Design 13Lecture 18 Activity Diagrams In the state diagram graph In the state diagram graph nodes represent system states nodes represent system states activities take place implicitly inside the states activities take place implicitly inside the states arcs are state transition conditions arcs are state transition conditions In activity diagram In activity diagram nodes represent activity (a linear sequence of actions) nodes represent activity (a linear sequence of actions) arcs represent control flow (conditional or parallel execution) arcs represent control flow (conditional or parallel execution)

CS540 Software Design 14Lecture 18 Activity Diagram for Air Gourmet Case Study

CS540 Software Design 15Lecture 18 Summary Interaction diagrams represent interaction among classes/objects Interaction diagrams represent interaction among classes/objects sequence diagrams are simplest, but time is linear and hard to represent complex interactions over time sequence diagrams are simplest, but time is linear and hard to represent complex interactions over time collaboration diagrams represent time via message sequence numbers; easier to show a complex sequence, harder to follow the flow collaboration diagrams represent time via message sequence numbers; easier to show a complex sequence, harder to follow the flow State diagrams show system states and state-change transitions Activity diagrams show parallel and conditional execution - very close to the old flowchart system