Sept 2003 91.3913 Ron McFadyen Interaction Diagrams - Chapter 15 Describe/illustrate sequence of message exchanges among objects that are working together.

Slides:



Advertisements
Similar presentations
Object Design Examples with GRASP
Advertisements

Object-Oriented Analysis and Design CHAPTERS 15: UML INTERACTION DIAGRAMS 1.
Jan 15, Ron McFadyen1 Ch 9. Use-case model: drawing System Sequence Diagrams Iteration: a simple cash-only success scenario of Process Sale.
Jan 23, Ron McFadyen1 SSD for a samplePOS Use Case Figure 13.1 Input Events invoke a system operation of the same name same idea as in object-oriented.
Sept Ron McFadyen Interaction Diagrams - Chapter 15 Describe/illustrate sequence of message exchanges among objects that are working together.
Oct Ron McFadyen Visibility Visibility: the ability of one object to see or have a reference to another object. e.g. When a register object.
Oct 22, Ron McFadyen1 Design Class Diagrams n Class diagram with – classes – associations – attributes – methods – navigability – interfaces,
Sequence Diagram Objects are represented horizontally across the top of the diagram The first object is typically an Actor, the one who initiates Each.
Sequence Diagram Objects are represented horizontally across the top of the diagram Each object has a lifeline some exist before and/or after some are.
Interaction Diagrams - Chapter 15 Describe/illustrate sequence of message exchanges among objects that are working together to achieve some functionality.
Interaction Diagrams - Chapter 15 Describe/illustrate sequence of message exchanges among objects show the flow of control across many objects used to.
Jan Ron McFadyen1 Consider a simple cash-only Process Sale scenario 1. Customer arrives at a POS checkout with goods and/or services to purchase.
Fall 2009AXS-3913 Ron McFadyen Visibility Visibility: the ability of one object to see or have a reference to another object. e.g. When a register object.
Sept Ron McFadyen Sequence Diagram Objects are represented horizontally across the top of the diagram The first object is typically an Actor,
1 © Wolfgang Pelz UML2 UML Part Two. 2 © Wolfgang Pelz UML2 Chapters Four & Twelve Interaction Diagrams.
Sept Ron McFadyen Interaction Diagrams - Chapter 15 Describe/illustrate sequence of message exchanges among objects that are working together.
© M.E. Fayad SJSU -- CmpE Software System Engineering Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I College of Engineering.
L26-S1 Interactions 2003 SJSU -- CmpE Advanced Object-Oriented Analysis & Design Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I.
Oct Ron McFadyen Visibility Visibility: the ability of one object to see or have a reference to another object. e.g. When a register object.
Feb 4, Ron McFadyen1 Design Class Diagrams n Class diagram with – classes – associations – attributes – methods – navigability – (interfaces,
November Ron McFadyen1 Design Class Diagrams n Class diagram with – classes – associations – attributes – methods – navigability – interfaces,
UML Sequence Diagrams Eileen Kraemer CSE 335 Michigan State University.
Object-Oriented Analysis and Design
November Ron McFadyen Visibility Visibility: the ability of one object to see or have a reference to another object. e.g. When a register object.
Sept Ron McFadyen1 Extend Relationship.
Sequence Diagram Objects are represented horizontally across the top of the diagram The first object is typically an Actor, the one who initiates Each.
SE-565 Software System Requirements More UML Diagrams.
Designing with Interaction and Design Class Diagrams Chapters 15 & 16 Applying UML and Patterns Craig Larman With some ideas from students in George Blank’s.
UML Collaboration Diagram. Recap System Sequence Diagrams (SSD) UML for SSD Examples.
Interactions. 2 Objects communicate with each other by sending messages. Sending a message is another name for a member function call. –Some C++ examples.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
מידול התנהגותי 1. Today’s Session Sequence Diagrams State Machines 2.
Interaction diagrams Sequence and collaboration diagrams.
Introduction to Interaction Diagrams Used to illustrate the dynamic behaviour of a community of objects that collaborate by passing messages in order to.
Object Design Examples with GRASP (Ch. 18)
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.
Starting Object Design
Chapter 4: UML Interaction Diagrams. Objective Provide a reference for frequently used UML interaction diagram notation- sequence and communication diagrams.
Behavioral Modeling Chapter 8.
Collaboration Diagrams CSIS3600. What is a Collaboration Diagram Collaboration diagrams illustrate interactions between objects The collaboration diagram.
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005 Interaction and Communication Diagrams Patrick Bailey Keith Vander Linden Calvin College.
Information Systems Engineering Interaction Diagrams: Sequence Diagram Collbortion Diagram.
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 Sequence Diagrams.
CSCI-383 Object-Oriented Programming & Design Lecture 12.
Collaboration diagrams. Purpose A collaboration diagram is an alternate way to show a scenario. A collaboration diagram shows the objects and relationships.
Communication Diagrams Lecture 8. Introduction  Interaction Diagrams are used to model system dynamics  How do objects change state?  How do objects.
Use-Case Model: Adding Detail with Operation Contracts.
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.
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.
Design Model: Determining Visibility CH-18. Objectives Identify four kinds of visibility. Design to establish visibility. Illustrate kinds of visibility.
Interactions.
Collaboration Diagrams
TIM 58 Chapter 6, continued: Behavioral Modeling
UML Interaction Diagrams
Chapter 11: Collaboration Diagram - PART1
Communication DIAGRAM
Princess Nourah bint Abdulrahman University
Requirements To Design In This Iteration
Princess Nourah bint Abdulrahman University
Sequence Diagrams Getting the Message.
Chapter 9: Sequence Diagrams Chapter 5 in Software Engineering Book
Communication DIAGRAM
Software Design (SE321) Lect6-Collaboration Diagram
Chapter 9: Sequence Diagrams Chapter 5 in Software Engineering Book
UML Interaction Diagrams
Chapter 4 Sequence Diagrams
Presentation transcript:

Sept Ron McFadyen Interaction Diagrams - Chapter 15 Describe/illustrate sequence of message exchanges among objects that are working together to achieve some functionality required in the system used to illustrate the design required to achieve the purpose Types Collaboration diagram Sequence diagram

Sept Ron McFadyen Sample Collaboration Diagram Suppose an event such as a light turning red occurs, and the traffic light must send a message to the camera letting it know that a red light occurred. PortageMain: trafficLight pm: camera changeToRed() 1:changeToRed() 1.1:takePhoto()

Sept Ron McFadyen Sample Sequence Diagram Suppose an event such as a light turning red occurs, and the traffic light must send a message to the camera letting it know that a red light occurred. PortageMain: trafficLightpm: camera changeToRed() takePhoto()

Sept Ron McFadyen Interaction Diagrams Messages asynchronous or synchronous components numbered (collaboration diagram) guard name parameter list name is mandatory... others as required

Sept Ron McFadyen Messaging Synchronous messages asynchronous messages return messages We will assume (at first) that all messages are synchronous: if object A sends a message to object B then A is suspended object B gains control, and B begins to compute object A waits until B responds (i.e. B sends a message back to A) When an asynchronous message is sent from A to B, A does not pause and wait for B to finish … results in multiple threads of control.

Sept Ron McFadyen Synchronous messages: We say that control, or the ability to compute, is gained by holding a token that is passed with a message. The object with the token is executing, or... You can consider there is an activation stack: when object A sends a message to object B, object B goes on to the top of the stack and it can compute. If B responds to A then B is popped from the stack and A, being at the top, begins to compute Messaging

Sept Ron McFadyen Collaboration Diagram Objects are represented similarly to classes in a class model … relationships are indicated clearly Objects may be named or unnamed Timing is understood by the numbering scheme. We use a nested decimal numbering to indicate the order in which messages are sent Many messages may be sent across one link :Student:Student

Sept Ron McFadyen Figure 15.3 Collaboration diagram for makePayment Messages numbered 1.1, 1.2, … are sent in response to receipt of message numbered 1. Return messages are often left out

Sept Ron McFadyen Figure 15.7 Messages Many messages may be sent across one link Messages numbered 1, 2, 3 are sent in response to receipt of message msg1; message 3.1 is sent in response to message 3

Sept Ron McFadyen Figure 15.8 Message to ‘this’ A message sent from an object to itself (i.e. invoking one of its own methods) is indicated by a reflexive link, but this does not imply a reflexive association

Sept Ron McFadyen Figure 15.9 Instance creation We will use a create message to indicate that an object is being instantiated

Sept Ron McFadyen Figure Sequence Numbering The initial message triggering the collaboration is unnumbered. All messages sent as the result of an object receiving a message numbered X, are prefixed with “X.”

Sept Ron McFadyen Figure Complex numbering We need a numbering scheme to know the order of messages

Sept Ron McFadyen Figure Conditional Message A guard (enclosed in square braces []) indicates a condition that must be true for the message to be sent

Sept Ron McFadyen Figure Mutually exclusive messages a, b, etc are used as suffixes to indicate mutually exclusive messages. A guard would accompany these

Sept Ron McFadyen Figure Iteration

Sept Ron McFadyen Figure Iteration over a multiobject A multi-object represents a collection of objects. E.g. the SalesLineItems for a Sale; E.g. the ProductSpecifications for a ProductCatalog

Sept Ron McFadyen Figure Messages to a class itself, not an object A message may be sent to the class, and not to a specific object.

Sept Ron McFadyen Collaboration Diagram - example Suppose we have classes for POrder, Customer, LineItem, Product with the following class model POrder LineItemProduct Customer * 1 We want to exhibit how objects of these classes communicate in order for the POrder to learn its value

Sept Ron McFadyen Collaboration Diagram - example Suppose POrder does not know its value. To determine its value it must ask each of its line items “what are you worth?”, and then ask the customer “what discount do you get”. Each line doesn’t remember the corresponding products price and so it must interrogate the product to determine the price POrder LineItemProduct Customer * 1

Sept Ron McFadyen Collaboration Diagram :POrder line1:LineItemTYZMonitor:Product line2:LineItemOptMouseX :Product JonesSupply:Customer 1:cost:=reportTotal() 1.1:price:=reportPrice() 2:reportTotal() 2.1:price:=reportPrice() 3:discount:=reportDiscount() reportTotal() Given that the objects below are involved, we show them along with the basic associations Since these are objects, not classes, there are no multiplicities Some message starts things off