1 / 17

Collaboration diagrams

Collaboration diagrams. 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.

Download Presentation

Collaboration diagrams

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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

  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: • Find User   1.1 LookUpUser • 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 makePaymentCollaboration Diagram • The message makePayment is sent to an instance of Register. The sender is not identified. • The Register instance sends the makePayment message to a Sale instance. • 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 

More Related