Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005 Interaction and Communication Diagrams Patrick Bailey Keith Vander Linden Calvin College.

Slides:



Advertisements
Similar presentations
Object-Oriented Analysis and Design CHAPTERS 15: UML INTERACTION DIAGRAMS 1.
Advertisements

ESE Einführung in Software Engineering 7. Modeling Behaviour Prof. O. Nierstrasz.
Ana M. Fernández  A UML diagram that depicts: ◦ interactions between objects. ◦ how the business currently works by showing how various.
Systems Analysis and Design in a Changing World, Fourth Edition
THE OBJECT-ORIENTED DESIGN WORKFLOW UML2 Sequence Diagrams.
1 © Wolfgang Pelz UML2 UML Part Two. 2 © Wolfgang Pelz UML2 Chapters Four & Twelve Interaction Diagrams.
OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 1 Interaction Diagrams.
03/12/2001 © Bennett, McRobb and Farmer Object Interaction Based on Chapter 9 of Bennett, McRobb and Farmer: Object Oriented Systems Analysis and.
Sequence Diagrams By Zvika Gutterman Adam Carmi. Agenda Interaction Diagrams A First Look at Sequence Diagrams Objects Messages Control Information Examples.
Sequence Diagram. What is Sequence Diagram?  Sequence Diagram is a dynamic model of a use case, showing the interaction among classes during a specified.
SE-565 Software System Requirements More UML Diagrams.
Chapter 7: The Object-Oriented Approach to Requirements
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
Sequence Diagram Tutorial
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005 Architecture: Component and Deployment Diagrams Patrick Bailey Keith Vander Linden Calvin College.
CS3773 Software Engineering
Interactions. 2 Objects communicate with each other by sending messages. Sending a message is another name for a member function call. –Some C++ examples.
מידול התנהגותי 1. Today’s Session Sequence Diagrams State Machines 2.
1 CSC 450 Slides adapted from slides created by Robert B. France UML Behavioral Models.
Interaction diagrams Sequence and collaboration diagrams.
UML / UML 2.0 Diagrams (Part III) 1. Sequence diagram is the most common kind of interaction diagram. It focuses on the message interchange between a.
State diagrams Interaction diagrams –Sequence diagrams –Collaboration diagrams Object orientation Part 4: Dynamic Modeling.
1 SAD2 - UML 2 nd Lecture Sequence Diagram and other dynamic views Lecturer: Dr Dimitrios Makris
Introduction to Interaction Diagrams Used to illustrate the dynamic behaviour of a community of objects that collaborate by passing messages in order to.
Systems Analysis and Design in a Changing World, 6th Edition
1 Sequence Diagrams (Based on Stevens and Pooley (2006, Chapters 9, 10) and Fowler (2004, Chapter 4)) David Meredith Aalborg University.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 9: Interaction.
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 UML Sequence Diagrams.
Chapter 4: UML Interaction Diagrams. Objective Provide a reference for frequently used UML interaction diagram notation- sequence and communication diagrams.
7 Systems Analysis and Design in a Changing World, Fifth Edition.
Collaboration Diagrams CSIS3600. What is a Collaboration Diagram Collaboration diagrams illustrate interactions between objects The collaboration diagram.
1 UML Sequence Diagrams UML Distilled, Third Edition, Chapter 4 M. Fowler.
Discovering object interaction. Use case realisation The USE CASE diagram presents an outside view of the system. The functionality of the use case is.
Interaction Diagrams Interaction Diagrams allow the designer to show how groups of objects collaborate in some behavior. –Interaction Diagrams will show.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour UML Sequence Diagram.
Object-Oriented Analysis and Design 1 Mira Balaban & Arnon Sturm Object-Oriented Analysis and Design Session 3a: Behavioral Modeling - Interactions.
Sequence Diagrams And Collaboration Diagrams HungNM.
Sequence Diagrams CSIS3600. Sequence Diagrams A sequence diagram shows an interaction arranged in time sequence. In particular, it shows the objects participating.
Object Oriented Analysis and Design Sequence Diagrams.
Use Case Driven Analysis Requirements Use Case Use Case Description System Sequence Diagram Chapter 5.
UNIFIED MODELING LANGUAGE(UML) BY Touseef Tahir Lecturer CS COMSATS Institute of Information Technology, Lahore.
Chapter 11 Activity Diagrams. 2 “Activity diagrams are a technique to describe procedural logic, business processes, and work flows” - M. Fowler An activity.
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part VI: Design Continuous Activity Diagams State Diagrams.
Systems Analysis and Design in a Changing World, Fourth Edition
Chapter 3: Introducing the UML
CSE 403 Lecture 8 UML Sequence Diagrams Reading: UML Distilled, Ch. 4, M. Fowler slides created by Marty Stepp
 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.
1 Kyung Hee University Interaction Diagrams Spring 2001.
1 7 Systems Analysis and Design in a Changing World, 2 nd Edition, Satzinger, Jackson, & Burd Chapter 7 The Object-Oriented Approach to Requirements.
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.
Systems Analysis and Design in a Changing World, Fourth Edition
Collaboration Diagrams
Standard UML: Communication and Dynamic Behavior
Sequence Diagram.
Sequence Diagram.
Sequence Diagram & UML Modeling Example
Princess Nourah bint Abdulrahman University
UML Sequence Diagrams.
Object Oriented Analysis and Design
Princess Nourah bint Abdulrahman University
IMAT5205 Systems Analysis and Design
Week 12: Activity & Sequence Diagrams
Interaction diagrams.
Chapter 9: Sequence Diagrams Chapter 5 in Software Engineering Book
Interaction Diagrams A Lot of UML!
Interaction diagrams Interaction diagrams are models that describe how groups of objects collaborate in some behavior. Typically, an interaction diagram.
Chapter 4 Sequence Diagrams
Presentation transcript:

Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005 Interaction and Communication Diagrams Patrick Bailey Keith Vander Linden Calvin College

Smith’s Aerospace © P. Bailey & K. Vander Linden, Interaction diagrams describe how groups of objects collaborate in some behavior. The UML defines several forms of interaction diagram, of which the most common is the sequence diagram. Ref: Martin Fowler – UML Distilled, 3 rd Edition

Smith’s Aerospace © P. Bailey & K. Vander Linden, You should use sequence diagrams when you want to look at how several objects interact with each other within a single use case. Sequence diagrams are good at showing collaborations among the objects; they are not so good at precise definition of the behavior. Sequence Diagrams Ref: Martin Fowler – UML Distilled, 3 rd Edition

Smith’s Aerospace © P. Bailey & K. Vander Linden, ● Analyze and design scenarios between objects. ● Refine object definition and behavior. ● Executable representation ● Basis for test cases Key Benefits Summarize

Smith’s Aerospace © P. Bailey & K. Vander Linden, What’s in a name… z:Dishwasher:Dishwasherx: An instance of the class Dishwasher which is named z. An anonymous instance of the class Dishwasher. Unspecified classifier. For the first two, Rhapsody looks for an existing class OR asks if you are creating a new one. { Lifeline

Smith’s Aerospace © P. Bailey & K. Vander Linden, From Rhapsody’s Documentation The recipient of a message is either a class or a reactive class. Reactive classes have statecharts, whereas nonreactive classes do not. Reactive classes can receive events, triggered operations, and primitive operations. Non-reactive classes can receive only messages that are calls to primitive operations. Events are usually shown with slanted arrows to imply that they are asynchronous (delivery takes time). Triggered operations are shown with straight arrows to imply that they are synchronous (happen immediately).

Smith’s Aerospace © P. Bailey & K. Vander Linden, A message represents an interaction between objects, or between an object and the environment. A message can be an event, a triggered operation, or a primitive operation. In the metamodel, a message defines a specific kind of communication. The communication could be raising a signal, invoking an operation, or creating or destroying an instance. Messages

Smith’s Aerospace © P. Bailey & K. Vander Linden, Synchronous Message The UML standard uses a straight line with a solid arrow at the end to represent a synchronous message. The message is noted on the line along with the inputs to the message. startSystem(mode = 1)

Smith’s Aerospace © P. Bailey & K. Vander Linden, Return Message Return messages are represented by a dash line with an open arrow at the end. Return values can be expressed if needed. status_result

Smith’s Aerospace © P. Bailey & K. Vander Linden, Example of Centralized Control Ref: Martin Fowler – UML Distilled, 3 rd Edition Execution Occurence

Smith’s Aerospace © P. Bailey & K. Vander Linden, Example of Distributed Control Ref: Martin Fowler – UML Distilled, 3 rd Edition

Smith’s Aerospace © P. Bailey & K. Vander Linden, Creation and Deletion of Participants Ref: Martin Fowler – UML Distilled, 3 rd Edition

Smith’s Aerospace © P. Bailey & K. Vander Linden, Slanted Messages (Asynchronous) In the UML standard, messages with an open arrowhead are asynchronous. Rhapsody adds to the standard. A message drawn on a slant is interpreted as an event if the target is a reactive class, and as a primitive operation if the target is a nonreactive class. A slanted message emphasizes that time passes between the sending and receiving of the message. Slanted messages can cross each other.

Smith’s Aerospace © P. Bailey & K. Vander Linden,

Smith’s Aerospace © P. Bailey & K. Vander Linden, Creating a Condition Mark A condition mark (or state mark) is displayed on an instance line. A condition mark shows that the object has reached a certain condition or is in a certain state. Often, the name corresponds to a state name in the object's statechart.

Smith’s Aerospace © P. Bailey & K. Vander Linden, Creating a Timeout The notation for timeouts is similar to the notation for events sent by an object to itself. There are two differences: A timeout starts with a small box. The name is a tm(x). The label on a timeout arrow is a parameter specifying the length of the timeout. Timeouts are always messages-to-self.

Smith’s Aerospace © P. Bailey & K. Vander Linden, Creating a Canceled Timeout When designing a software system, you can establish waiting states, during which your program waits for something to occur. If the event occurs, the timeout is canceled. The sequence diagram shows this with a canceled timeout symbol. If it does not happen, the timeout wakes up the instance and resumes with some sort of error recovery process. Canceled timeouts are always messages-to-self.

Smith’s Aerospace © P. Bailey & K. Vander Linden, OperatorMeaning alt Alternative multiple fragments; only the one whose condition is true will execute (Figure 4.4). opt Optional; the fragment executes only if the supplied condition is true. Equivalent to an alt with only one trace (Figure 4.4). par Parallel; each fragment is run in parallel. loop Loop; the fragment may execute multiple times, and the guard indicates the basis of iteration (Figure 4.4). region Critical region; the fragment can have only one thread executing it at once. neg Negative; the fragment shows an invalid interaction. ref Reference; refers to an interaction defined on another diagram. The frame is drawn to cover the lifelines involved in the interaction. You can define parameters and a return value. sd Sequence diagram; used to surround an entire sequence diagram, if you wish. Common Operators for Interaction Frame Ref: Martin Fowler – UML Distilled, 3 rd Edition

Smith’s Aerospace © P. Bailey & K. Vander Linden, Interaction Frames procedure dispatch foreach (lineitem) if (product.value > $10K) careful.dispatch else regular.dispatch end if end for if (needsConfirmation) messenger.confirm end procedure Ref: Martin Fowler – UML Distilled, 3 rd Edition

Smith’s Aerospace © P. Bailey & K. Vander Linden, Use of Reference Referenced frame

Smith’s Aerospace © P. Bailey & K. Vander Linden, Reference Example Continued Frame Name

Smith’s Aerospace © P. Bailey & K. Vander Linden, Parallel Operation Example

Smith’s Aerospace © P. Bailey & K. Vander Linden, Rhapsody’s Implementation The Toolbar

Smith’s Aerospace © P. Bailey & K. Vander Linden,

Smith’s Aerospace © P. Bailey & K. Vander Linden, Communication Diagrams These emphasize the organizations of objects that participate in an interaction. Typically, it is vertically oriented, and unlike sequence diagrams they do not show the lifeline of an object nor do they show the focus of control.

Smith’s Aerospace © P. Bailey & K. Vander Linden, Example of Communication Diagram

Smith’s Aerospace © P. Bailey & K. Vander Linden, Which comes first – collaboration or class diagrams? Generally, make an initial pass on classes Collaboration diagrams may require you to re-evaluate your class design. It is a cyclic, iterative process of understanding.

Smith’s Aerospace © P. Bailey & K. Vander Linden, Final thought ● To model flows of control by timing order, the sequence diagram is more appropriate. ● Communication diagrams are best when modeling flows of control by organization.

Smith’s Aerospace © P. Bailey & K. Vander Linden,

Smith’s Aerospace © P. Bailey & K. Vander Linden,

Smith’s Aerospace © P. Bailey & K. Vander Linden,

Smith’s Aerospace © P. Bailey & K. Vander Linden,

Smith’s Aerospace © P. Bailey & K. Vander Linden,