Collaboration Diagrams CSIS3600. What is a Collaboration Diagram Collaboration diagrams illustrate interactions between objects The collaboration diagram.

Slides:



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

1 Behavioral Modeling Chapter 8. 2 Key Ideas Behavioral models describe the internal dynamic aspects of an information system that supports business processes.
Interaction Diagrams Activity Diagram State Machine Diagram
Interaction Diagrams - Chapter 15 Describe/illustrate sequence of message exchanges among objects that are working together to achieve some functionality.
Drawing System 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 5: Restaurant.
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.
Object Collaborations. Objectives: Object Interaction (cont.) You will be able to:  Use sequence diagrams to detail object interactions.
Dynamic modeling using UML
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.
Slide 1 Use Case Sequence Diagram. Slide 2 Interaction Diagrams l Interaction diagrams model the behavior of use cases by describing the way groups of.
LECTURE 5 SEQUENCE DIAGRAM 1. INTRODUCTION – SYSTEM SEQUENCE DIAGRAM A system sequence diagram is a fast and easily created artifact that illustrates.
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
INFO 620Lecture #51 Information Systems Analysis and Design Sequence and Collaboration Diagrams INFO 620 Glenn Booker.
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.
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.
1 On to Object Design Chapter 14 Applying UML and Patterns.
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.
Copyright © Hsiao-Lan Wei All Rights Reserved Design Model Interaction diagram.
Starting Object Design
Chapter 4: UML Interaction Diagrams. Objective Provide a reference for frequently used UML interaction diagram notation- sequence and communication diagrams.
® IBM Software Group © 2006 IBM Corporation Rational Software France Object-Oriented Analysis and Design with UML2 and Rational Software Modeler 02. Objects,
Engineering 5895: Software Design 10/5/01Interaction Diagrams1 Modeling Behaviour Engineering 5895: Software Design.
UML Class Diagram Trisha Cummings. What we will be covering What is a Class Diagram? Essential Elements of a UML Class Diagram UML Packages Logical Distribution.
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005 Interaction and Communication Diagrams Patrick Bailey Keith Vander Linden Calvin College.
Sequence diagram in UML Martin Palkovik. Sequence diagram  It is a graphic representation of system operations based on chronology - a time sequence.
An Introduction to the Unified Modeling Language
Discovering object interaction. Use case realisation The USE CASE diagram presents an outside view of the system. The functionality of the use case is.
Information Systems Engineering Interaction Diagrams: Sequence Diagram Collbortion Diagram.
Drawing System Sequence Diagrams
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.
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.
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
Collaboration diagrams. Purpose A collaboration diagram is an alternate way to show a scenario. A collaboration diagram shows the objects and relationships.
1 LAB What is Collaboration diagram? 4 Collaboration diagrams illustrate the interaction between the objects, using static spatial structure. 4.
Chapter 3: Introducing the UML
Diagram Editor : Use Case VIew
Communication Diagrams Lecture 8. Introduction  Interaction Diagrams are used to model system dynamics  How do objects change state?  How do objects.
UML Fundamental Elements. Structural Elements Represent abstractions in our system. Elements that encapsulate the system's set of behaviors. Structural.
1 Kyung Hee University Interaction Diagrams Spring 2001.
Chapter 7 Behavioral Modeling Brandon A. Jones Stand and Deliver ITEC March 6, 2011.
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.
1 Systems Analysis and Design Behavioral Modeling Chapter 8 (Last one before the Midterm!)
Interactions.
Collaboration Diagrams
Chapter 11: Collaboration Diagram - PART1
Communication DIAGRAM
Prepared By Sidra Noureen
Behavioral Modeling.
Sequence Diagrams.
Princess Nourah bint Abdulrahman University
Interactions.
Object Oriented Analysis and Design
Requirements To Design In This Iteration
Princess Nourah bint Abdulrahman University
Classification of UML Diagrams
IMAT5205 Systems Analysis and Design
Week 12: Activity & Sequence Diagrams
Unified Modelling Language
Interaction diagrams Interaction diagrams are models that describe how groups of objects collaborate in some behavior. Typically, an interaction diagram.
Communication DIAGRAM
Software Design (SE321) Lect6-Collaboration Diagram
UML Interaction Diagrams
Presentation transcript:

Collaboration Diagrams CSIS3600

What is a Collaboration Diagram Collaboration diagrams illustrate interactions between objects The collaboration diagram illustrates messages being sent between classes and objects (instances). Collaboration diagrams express both the context of a group of objects (through objects and links) and the interaction between these objects (by representing message broadcasts)

Purpose of the Collaboration Diagram They are very useful for visualizing the relationship between objects collaborating to perform a particular task They provide a good view – albeit static - view of interaction between objects which may be difficult to see at the class level

Collaboration Diagram Represents a Collaboration and Interaction Collaboration­set of objects and their interactions in a specific context Interaction­set of messages exchanged in a collaboration to produce a desired result

Ex. Collaboration Diagram

Collaboration Diagram Elements There are three primary elements of a collaboration diagram: –Objects –Links –Messages

Collaboration Diagram Syntax AN ACTOR AN OBJECT AN ASSOCIATION A MESSAGE anObject:aClass aMessage()

Objects Objects­rectangles containing the object signature­object signature: –object name : object Class –object name (optional) - starts with lowercase letter –class name (mandatory) - starts with uppercase letter Objects connected by lines­actor can appear

Objects Objects participating in a collaboration come in two flavors—supplier and client Supplier objects are the objects that supply the method that is being called, and therefore receive the message Client objects call methods on supplier objects, and therefore send messages

Transaction object acts as a Supplier to the UI (User Interface) Client object. In turn, the Fine object is a Supplier to the Transaction Client object.

Links The connecting lines drawn between objects are links They enable you to see the relationships between objects This symbolizes the ability of objects to send messages to each other A single link can support one or more messages sent between objects

The visual representation of a link is a straight line between two objects. If an object sends messages to itself, the link carrying these messages is represented as a loop icon. This loop can be seen on both the UI object and the Transaction object.

Messages An interaction is implemented by a group of objects that collaborate by exchanging messages Messages in collaboration diagrams are shown as arrows pointing from the Client object to the Supplier object. Typically, messages represent a client invoking an operation on a supplier object

Messages Message icons have one or more messages associated with them Messages are composed of message text prefixed by a sequence number Time is not represented explicitly in a collaboration diagram, and as a result the various messages are numbered to indicate the sending order

Flow by Number

Flow by Numbers 1.Enter Borrower ID 1.1 CalcAmtCanBorrow > CalcBorrowerFines GetBorrowersCheckedOutMedia IsMediaOverdue Amt Can Borrow 1.2 Display Invalid User Msg

Same as for sequence diagrams Synchronous Flow of control Asynchronous Return Message Flow Notation

Iterating Messages Collaboration diagrams use syntax similar to sequence diagrams to indicate that either a message iterates (is run multiple times) or is run conditionally –An asterisk (*) indicates that a message runs more than once –Or the number of times a message is repeated can be shown by numbers (for example, 1..5)

Conditional Messages To indicate that a message is run conditionally, prefix the message sequence number with a conditional [guard] clause in brackets [ x = true ]: [IsMediaOverdue] This indicates that the message is sent only if the condition is met

Collaboration vs Sequence Diagram In reality, sequence diagrams and collaboration diagrams show the same information, but just present it differently Not used as often as sequence diagrams but are closely related

Sequence diagram is better at ‘time ordering’

Collaboration diagram is better at showing the relationship between objects

Number of Messages In sequence diagrams, each message icon represents a single message. In collaboration diagrams, a message icon can represent one or more messages. Notice between the Transaction and Fine objects - there is a single message icon, but there are two messages (1.1.1 and 1.1.2) associated with the icon.

Collaboration and Class Diagrams Links in a collaboration diagram directly correlate to associations between classes in a class diagram

Steps to Creating a Collaboration Diagram 1.Determine the scope of the diagram- the use case it relates to 2.Place the objects that participate in the collaboration on the diagram –Remember to place the most important objects towards the center of the diagram. 3.If a particular object has a property or maintains a state that is important to the collaboration, set the initial value of the property or state

Steps to Creating a Collaboration Diagram 4.Create links between the objects 5.Create messages associated with each link 6.Add sequence numbers to each message corresponding to the time-ordering of messages in the collaboration

Creation and Deletion Unlike sequence diagrams, you don't show an object's lifeline in a collaboration diagram If you want to indicate the lifespan of an object in a collaboration diagram, you can use create and destroy messages to show when an object is instantiated and destroyed

Objects Changing State State of on object can be indicated Initial state is indicated with > If an object changes significantly during an interaction, you can add a new instance of the object to the diagram, draw a link between them and add a message with the stereotype >

Change State of an Object

Example Collaboration Diagram

Reference 2/mayjune/collaborationdiagrams/codemag- 2.asphttp:// 2/mayjune/collaborationdiagrams/codemag- 2.asp