Presentation is loading. Please wait.

Presentation is loading. Please wait.

Collaboration diagrams. Purpose A collaboration diagram is an alternate way to show a scenario. A collaboration diagram shows the objects and relationships.

Similar presentations


Presentation on theme: "Collaboration diagrams. Purpose A collaboration diagram is an alternate way to show a scenario. A collaboration diagram shows the objects and relationships."— Presentation transcript:

1 Collaboration diagrams

2 Purpose A collaboration diagram is an alternate way to show a scenario. A collaboration diagram shows the objects and relationships involved in an interaction, and the sequence of messages exchanged among the objects during the interaction.

3 Compared with a sequence diagram A sequence diagram shows the objects and messages involved in an interaction. They convey the same information as sequence diagrams, but they focus on object roles instead of the times that messages are sent Sequence diagrams show the timing of the messages, but not the relationships among the objects. A distinguishing feature of a Collaboration diagram is that it shows the objects and their association with other objects in the system apart from how they interact with each other. –The association between objects is not represented in a Sequence diagram. Within sequence diagrams the order of interactions is established by vertical positioning whereas in collaboration diagrams the sequence is given by numbering the interactions.

4 Elements of a collaboration diagram Object: The objects interacting with each other in the system. Depicted by a rectangle with the name of the object in it, preceded by a colon and underlined. Relation/Association: A link connecting the associated objects. Qualifiers can be placed on either end of the association to depict cardinality. Messages: An arrow pointing from the commencing object to the destination object shows the interaction between the objects. The number represents the order/sequence of this interaction.

5 Messages Unlike sequence diagrams, collaboration diagrams do not have an explicit way to denote time and instead number messages in order of execution. Sequence numbering can become nested using the Dewey decimal system. –For example, nested messages under the first message are labeled 1.1, 1.2, 1.3, and so on. –The a condition for a message is usually placed in square brackets immediately following the sequence number. –Use a * after the sequence number to indicate a loop.

6 Messages

7 Example An Administrator using a Web Application to manage a user account. Notice how you can follow the process from object to object, according to the outline below: 1.Find User 1.1 LookUpUser 2.Update User 2.1 ValidateUser 2.2 UpdateUser

8 Example

9 As a decomposition diagram The collaboration diagram can be a decomposition of a class, class diagram, or part of a class diagram; it can be the decomposition of a use case, use case diagram, or part of a use case diagram.

10 Collaboration diagrams illustrate object interactions in a graph or network format.

11 Example Collaboration Diagram: makePayment

12 How to Read the makePayment Collaboration Diagram 1.The message makePayment is sent to an instance of Register. The sender is not identified. 2.The Register instance sends the makePayment message to a Sale instance. 3.The Sale instance creates an instance of a Payment.

13 Example Sequence Diagram: makePayment

14 Messages to “self” or “this” A message can be sent from an object to itself. This is illustrated by a link to itself, with messages flowing along the link.

15 Conditional Messages A conditional message is shown by following a sequence number with a conditional clause in square brackets, similar to the iteration clause. The message is sent only if the clause evaluates to true.  Collaboration Diagram Sequence Diagram 

16 Mutually Exclusive Conditional Paths  Collaboration Diagram Sequence Diagram 

17 Iteration or Looping Iteration is indicated by following the sequence number with a star * This expresses that the message is being sent repeatedly, in a loop, to the receiver. It is also possible to include an iteration clause indicating the recurrence values.  Collaboration Diagram Sequence Diagram 


Download ppt "Collaboration diagrams. Purpose A collaboration diagram is an alternate way to show a scenario. A collaboration diagram shows the objects and relationships."

Similar presentations


Ads by Google