Visual Paradigm for UML 2.0

Collaboration Diagram

 

 

What is Collaboration Diagram?

A collaboration diagram is an interaction diagram that emphasizes the structural organization of the objects that send and receive messages. It is crossed between a symbol diagram and a sequence diagram. It describes a specific scenario. Numbered arrows show the movement of messages during the course of a scenario. Collaboration diagram express similar information as in sequence diagram, but shown in different way.

*   Figure 7.1 Collaboration Diagram

 

 

 

When to use Collaboration Diagrams?

We use Collaboration Diagram when we prefer to show a spatial organization of symbols and interactions rather than concentrating on the sequence of the interactions

 

 

 

 


 

Creating a Collaboration Diagram

Method 1 ¡V Creating a Collaboration Diagram using the Menu Bar

1.  Click on File on the menu bar. The file menu appears.

2.  Click on New Diagram on the file menu. A cascading menu appears.

3.  Click on New Collaboration Diagram on the cascading menu. A blank new collaboration diagram appears.


 

Method 2 ¡V Creating a Collaboration Diagram using the Toolbar

1.  Click on Create Collaboration Diagram  on the toolbar. A blank new collaboration diagram appears.


Method 3 ¡V Creating a Collaboration Diagram using the Project Explorer

1.  Right click on Collaboration Diagram directory in the Project Explorer. A pop-up menu appears.

2.  Click on Create Collaboration Diagram. A blank new collaboration diagram appears.

 


*   Figure 7.2 A blank new collaboration diagram is created.

 


The Collaboration Diagram Palette

 

 

Icon

Notation

Definition

Note

A note can be used for comments additional explanation, specification and requirement in a diagram element or at a link in the diagram. It is not included in generated code.  The contents of a note do not alter the meaning of the model to which it is attached. A note can contain any combination of text and graphics. It can also be used in defining a stereotype and entering a noted element. (adapted from UMLUG-purple)

Anchor

An anchor is to line a diagram element and a note.

Constraint

A constraint is a semantic condition or restriction on model elements that must be enforced by a correct

design of a system. It is represented as a linguistic, enclosed in braces ({}), statement in some formal

(OCL, C++, and other), or natural language. There are 14 standard constraints in the UML such as

association, global, parameter. You may also define your own constraints.

Package

Package is a mechanism for organizing elements into groups. It is used in the Use Case, Class, and Component diagrams. Packages may be nested within other packages. A package may contain both subordinate packages and ordinary model elements.  The entire system description can be thought of as a single high-level subsystem package with everything else in it.

Subsystem

A subsystem groups use cases or packages together.

Dependency

The dependency link is a semantic relationship between the two elements. It indicates that when a change occurs in one element, there may be a change necessary to the other element.  A dependency link can include label and stereotype can be set.

Object

An object can be viewed as an entity at a particular point in time with a specific value and as a holder of identity that has different values over time.  Associations among objects are not shown. When you place an object tag in the design area, a lifeline is automatically drawn and attached to that object tag. You can define object attributes and assign initial values.

Classifier Role

A classifier role is a specific role played by a participant in a collaboration. It specifies

a restricted view of a classifier, defined by what is required in the collaboration.

 

Link

A link is a connection between two objects. It is a tuple of object references, and also an instance of association. (UMLUG-red)

Association Role

Relationships between classifier roles are defined by association roles. An association role is shown with

the usual association line. The name string of the association role follows the same syntax as for the

classifier role. If the name is omitted, a line connected to classifier role symbols denotes an association

role.

Message to

The action that performs from one object to another.

Message from

The action that another object performs to itself.

Actor

An actor represents a coherent set of roles that users of a system play when interacting with the use cases of the system.  An actor participates in use cases to accomplish an overall purpose.  An actor can represent the role of a human, a device, or any other systems

Generalization

Generalization is a relationship between a general element and a more specific kind of that element. It means that the more specific element can be used whenever the general element appears. This relation is also known as specialization or inheritance link.

Swimlane

A swimlane is a way to group activities performed by the same actor on an activity diagram or to group activities in a single thread (Douglass 1999). Each zone or lane represents the responsibilities of a particular class. To use swimlane, you must arrange activity diagrams into vertical zones separated by dashed lines. Transitions may cross boundaries

*   Figure 7.3 Collaboration Diagram Palette of VPUML

 

 

Drawing a Collaboration Diagram

 

Creating an Object

Method 1 ¡V Creating an Object using the Diagram Palette

1.  Click on Object button  on the Diagram Palette and click on the desired location on diagram. A new object is created.

2.  Rename the newly created object. Press Ctrl + Enter to finish the operation.   

è

 

Method 2 ¡V Creating an object using the resource centric interface

Diagram element that an object can be created from, using the resource centric interface is:

l Actor

 

1.  Click on an existing actor. The resource icons appear around the diagram element.

è

2.  Press on the Link to Object resource icon . A new object appears.

 

3.  Drag the object to the desired location. Release the mouse button.

è

 

4.  Rename the newly created object. Press Ctrl + Enter to finish the operation.

è

 


Creating an Actor

Method 1 ¡V Creating an actor using the Diagram Palette

1.  To create an actor in your collaboration diagram, click on the Actor button  on the Diagram Palette and click on to the desired location on diagram. A new actor appears.

 

2.  Rename the newly created actor name. Press Ctrl + Enter to finish the operation.

3.  The actor name is set.

 

Method 2 ¡V Creating an actor using the resource centric interface

Diagram element that an actor can be created from, using the resource centric interface is:

l Object

 

1.  Click on an existing object. The resource icons appear around the diagram element.

è

2.  Press on the Link to Actor resource icon . A new actor appears.

 

3.  Drag the actor to the desired location. Release the mouse button.

è

 

4.  Rename the newly created actor. Press Ctrl + Enter to finish the operation.

è

 


Creating a Package

Method 1 ¡V Creating a package using the Diagram Palette

1.  To create a package in your collaboration diagram, click on the Package button  on the Diagram Palette and click on to the desired location on diagram. A new package appears.

2.  Rename the newly created package name. Press Ctrl + Enter to finish the operation.

3.  The package name is set.

 

 


Creating a Subsystem

Method 1 ¡V Creating a subsystem using the Diagram Palette

1.  To create a subsystem in your collaboration diagram, click on the Subsystem button  on the Diagram Palette and click on to the desired location on diagram. A new subsystem appears.

2.  Rename the newly created subsystem name. Press Ctrl + Enter to finish the operation.

3.  The subsystem name is set.

 


Creating a Classifier Role

Method 1 ¡V Creating a Classifier Role using the Diagram Palette

1.  To create a classifier role in your collaboration diagram, click on the Classifier Role button  on the Diagram Palette and click on to the desired location on diagram. A new classifier role appears.

2.  Rename the newly created classifier role name. Press Ctrl + Enter to finish the operation.

3.  The classifier role name is set.

 

 

 


Creating a Link

Method 1 - Creating a link

1.  Click on Link button  on the diagram palette.

2.  Click on an existing actor or object. Drag to the target diagram element.

3.  Release the mouse button.

 

Method 2 - Creating a link using the resource centric interface

Diagram elements that a link can be created from, using the resource centric interface are:

l Actor

l Object

 

1.  Click on the object. The resource icons appear around the object.

2.  Press on the Actor button. An actor appears.

3.  Drag the actor to the target diagram element. The target diagram element is selected.

è

4.  Release the mouse button. A link is created between the object and the actor.

 


Creating an Association Role

Method 1 - Creating an association role

1.  Click on Association Role button  on the diagram palette.

2.  Click on an existing classifier role. Drag to the target diagram element.

3.  Release the mouse button.

 

Method 2 - Creating an association role using the resource centric interface

Diagram elements that an association role can be created from, using the resource centric interface are:

l Classifier Role

 

1.  Click on the classifier. The resource icons appear around the classifier.

2.  Press on the Classifier Role . A classifier role appears.

3.  Drag the classifier to the target diagram element. The target diagram element is selected.

è

4.  Release the mouse button. An association role is created between the ClassifierRole1 and the ClassifierRole2.

 

 

 


Creating a Message to

Method 1 - Creating a message to

 

1.  Click on Message To button  on the Diagram Palette.

 

2.  Click on the link that you want to create message.

3.  Rename the newly created message to. Press Ctrl + Enter to finish the operation.

 

 

 


Creating a Message from

Method 1 - Creating a message from

 

1.  Click on Message from button  on the Diagram Palette.

2.  Click on the link that you want to create message from.

3.  Rename the newly created message from. Press Ctrl + Enter to finish the operation.

 

 


Reorder Sequence Numbers of Messages

 

1.  Right click on a blank place on the diagram. A popup menu appears.

 

2.  Click on Reorder Messages¡K on the popup menu. The Collaboration Diagram Specification dialog appears. A list of messages is shown with their sequence number.

 

3.  Right click on a message in the dialog. A popup menu appears.

 

4.  Click Move Up / Move Down in the popup menu. The message will be moved up or down

 

5.  Click on the Reset Sequence Number in the dialog. The sequence numbers of the messages are updated.

 

6.  Click on the OK button. The dialog is closed. The sequence numbers of the messages on the diagram are updated.

 

 

 


Creating a Swimlane

Method 1 - Creating a swimlane

 

1.  Click on Swimlane button  on the Diagram Palette.

It is suggested that the swimlane should be created before any other diagram elements in collaboration diagram. It is because the swimlane is a containment diagram element, if any other diagram elements are created before the swimlane, these diagram elements may need to relocate. Once the diagram element is contained by swimlane, when the swimlane is moved, all the diagram elements contained by the swimlane will be moved too.

 

 

2.  Click on anywhere in the diagram. A new swimlane appears on the diagram.

 

The first created swimlane is always placed on the top of the diagram, and the second created swimlane will be placed under the first created swimlane, and so on. You can move the swimlane up or down by dragging the swimlane over the swimlane bar.

 

3.  Rename the newly created swimlane. Press Ctrl + Enter to finish the operation.

 

 

If you want to resize the swimlane, you can move the cursor over the edge on the swimlane bar. Then drag it to the appropriate size you want and release the mouse.

 

 


Creating a Generalization Relationship

You can create generalization relationship between actors.

1.  Click on the generalized actor. The resource icons appear around the actor.

2.  Press on the generalization from actor resource icon . An actor appears.

 

3.  Drag the actor to the target diagram element. The target diagram element is selected.

è

 


4.  Release the mouse button. A generalization relationship is created between the generalized actor and the specialized actor.


Editing an Object Specification

You can edit the specification of an object.

1.  Right click on the object you want to edit. A pop-up menu appears.

2.  Click on Open Specification. The properties of the object can be modified using the object specification dialog box.

 


Editing an Actor Specification

1.  Right click on the actor. A pop-up menu appears.

2.  Click on Open Specification. The actor specification dialog box appears. The properties of the actor specification can be modified using the actor specification dialog box.

 

 

 


Generating a Sequence Diagram

 

1.  Open a collaboration diagram from the Project Explorer. Double click on a blank place on the diagram to generate a new sequence Diagram.

 

2.  A new sequence diagram is generated.

 

3.  A new sequence diagram is generated from the collaboration diagram.

 

=>

 

 

 

 


Example

 

1.  Click on the Swimlane icon on the toolbar, and then click anywhere in the diagram. A swimlane appears in the diagram.

 

2.  Rename the newly created swimlane as ¡§Actor¡¨. Press Ctrl + Enter to finish the operation.

 

3.  Click on the Swimlane icon  on the toolbar to create three more swimlane(s) on the diagram. Name it as ¡§UI¡¨, ¡§Control¡¨ and ¡§Model¡¨. The diagram will look as follow.

 

4.  Click on the Actor button on the toolbar, and then click on the Actor swimlane. An actor is created.

 

5.  Rename the newly created actor name as ¡§Customer¡¨. Press Ctrl + Enter to finish the operation.

è

 

6.  Click on the Actor button on the toolbar to create another actor as ¡§Staff¡¨.

è

 

7.  Click on the Link button on the toolbar. Press on ¡§Customer¡¨ and then drag to ¡§Staff¡¨ to create a link.

 

8.  Click on ¡§Staff¡¨, the resource icons appear around the ¡§Staff¡¨. Click on the Object icon, drag to ¡§UI¡¨ swimlane to create an object.

è

 

9.  Rename the newly created object as ¡§Search Vehicle UI¡¨.

 

10.              Right click on the mouse button on the ¡§Search Vehicle UI¡¨. A pop-up menu appears.


11.              Click on Open Specification, the object specification dialog box appears.

12.              Click on the Stereotype pull-down box, choose boundary. Then click OK to close the dialog box.


13.              The Interface of ¡§Search Vehicle UI¡¨ will change as the following figure.

 

14.              Press on the Object icon, drag to Control swimlane to create another object.


15.              Rename the newly created object as ¡§Rental Vehicle Control¡¨, then right click on it to open the object specification dialog box.

 

16.              Set the Stereotype type as control. Then click OK to close the dialog box.

 


17.              The interface of the ¡§Rental Vehicle Control¡¨ will change as the following figure.

 

 

18.              According to the following table, create other objects on the diagram.

 

Object Name

Stereotype

Link with

Placement

Search Vehicle Control

control

Rental Vehicle Control

Control swimlane

Vehicle

none

Search Vehicle Control

Model swimlane

Validate Customer UI

boundary

Staff, Rental Vehicle Control

UI swimlane

Validate Customer Control

control

Rental Vehicle Control

Control swimlane

Customer

none

Validate Customer Control

Model swimlane

 


19.              The diagram will look like the following:

 

 

20.              Click on the Message To icon on the toolbar. Then click on the link which is between Customer and Staff.

 

21.              Rename the message to as ¡§1. rent a vehicle¡¨.


22.              According to the following table, create the message to and message from on the diagram.

 

From

To

Message Type

name

Staff

Validate Customer UI

message to

2. input customer id

Validate Customer UI

Rental Vehicle Control

message to

3. validateCustomer

Rental Vehicle Control

Validate Customer Control

message to

4. validateCustomer

Validate Customer Control

Customer

message to

5. isSuspended

Customer

Validate Customer Control

message from

6. boolean

Validate Customer Control

Rental Vehicle Control

message from

7. customer

Rental Vehicle Control

Validate Customer UI

message from

8. String

Validate Customer UI

Staff

message from

9. customer is valid

Staff

Search Vehicle UI

message to

10. input model number

Search Vehicle UI

Rental Vehicle Control

message to

11. searchAvailableVehicle

Rental Vehicle Control

Search Vehicle Control

message to

12. searchAvailableVehicle

Search Vehicle Control

Vehicle

message to

13. isAvailable

Vehicle

Search Vehicle Control

message from

14. boolean

Search Vehicle Control

Rental Vehicle Control

message from

15. vehicle

Rental Vehicle Control

Search Vehicle UI

message from

16. String

Search Vehicle UI

Staff

message from

17. vehicle is no available

Staff

Customer

message from

18. suggest other choice

Customer

Staff

message to

19. not accept other choice

 


 

23.              The completed diagram will look like the following.

 


Exercise

Draw the following diagram according to the guidelines given in this chapter.

 

*           Figure 7.4 Collaboration Diagram Exercise

First | Previous | Next | Last
Patents pending. All rights reserved.