0% found this document useful (0 votes)
17 views3 pages

OPPs

oops notes

Uploaded by

Shikha Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
17 views3 pages

OPPs

oops notes

Uploaded by

Shikha Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 3
UML Collaboration Diagram The collaboration diagram is used to show the relationship between the objects in a system. Both the sequence and the collaboration diagrams represent the same information but differently. instead of showing the flow of messages, it depicts the architecture of the object residing in the system as it is based on object-oriented programming. An object consists of several features. Multiple objects present in the system are connected to each other. The collaboration diagram, which is also known as a communication diagram, is used to portray the object's architecture in the system. Notations of a Collaboration Diagram Following are the components of a component diagram that are enlisted below: 1. Objects: The representation of an object is done by an object symbol with its name and. class underlined, separated by a colon. In the collaboration diagram, objects are utilized in the following ways: © The object is represented by specifying their name and class. © Itis not mandatory for every class to appear. © Aclass may constitute more than one object. © Inthe collaboration diagram, firstly, the object is created, and then its class is specified. © To differentiate one object from another object, it is necessary to name them. 2. Actors:.In the collaboration diagram, the actor plays the main role as it invokes the interaction. Each actor has its respective role and name. In this, one actor initiates the use case. an instance of association, which associates the objects and actors. It portrays a relationship between the objects through which the messages are sent. It is represented by a solid line. The link helps an object to connect with or navigate to another object, such that the message flows are attached to links. 4, Messages: It is a communication between objects which carries information and includes a sequence number, so that the activity may take place. It is represented by a labeled arrow, which is placed near a link. The messages are sent from the sender to the receiver, and the direction must be navigable in that particular direction. The receiver must understand the message. Components of a collaboration diagram lagi name When to use a Collaboration Diagram? ‘The collaborations are used when it is essential to depict therelationship between the object. Both the sequence and collaboration diagrams represent the same \nformation, but the way of portraying it quite different. The collaboration diagrams are best suited fcr analyzing use cases. \ Following are some of the use cases enlisted below for Vhich the collaboration diagram is implemented: 1. To model collaboration among the objects or roles that dry the functionalities of use cases and operations. 2. To model the mechanism inside the architectural design chine system, 3. To capture the interactions that represent the flow of messiges between the objects and the roles inside the collaboration. \ 4, To model several objects and interactions. \ ‘To support the identification of objects participating in the usease. ifferent scenarios within the use case or operation, involving a collaboration of In the collaboration diagram, each message constitutes a seqvence number, such that the top-level message is marked as one and so on. The messages ‘ent during the same call are denoted with the same decimal prefix, but with different suffijes of 1, 2, etc. as per their occurrence. Steps for creating a Collaboration Diagram 1. Determine the behavior for which the realization and implementation are specified. 2. Discover the structural elements that are class roles, objects, and subsystems for performing the functionality of collaboration. © Choose the context of an interaction: system, subsystem, use case, and operation. 3, Think through alternative situations that may be involved. © Implementation of a collaboration diagram at an instance level, if needed, A specification level diagram may be made in the instance level sequence diagram for summarizing alternative situations. Example of a Collaboration Diagram Mme ORRRY <- Jrmsteteeniton | Debs iH 4 Pmsteneserston — BESET ees 8 isso Benefits of a Collaboration Diagram 1. The collaboration diagram is also known as Communication Diagram. 2. It mainly puts emphasis on the structural aspect of an interaction diagram, ie., how lifelines are connected. 3. The syntax of a collaboration diagram is similar to the sequence diagram; just the difference Is that the lifeline does not consist of tails. 4, The messages transmitted over sequencing is represented by numbering each individual message. The collaboration diagram is semantically weak in comparison to the sequence diagram. ‘The special case of a collaboration diagram is the object diagram. It focuses on the elements and not the message flow, like sequence diagrams. PrN ow Since the collaboration diagrams are not that expensive, the sequence diagram can be directly converted to the collaboration diagram, 9. There may be a chance of losing some amount of information while implementing 2 collaboration diagram with respect to the sequence diagram. ‘The drawback of a Collaboration Diagram 1. Multiple objects residing in the system can make a complex collaboration diagram, as it becomes quite hard to explore the objects. 2. Its a time-consuming diagram. After the program terminates, the object is destroyed. 4. As the object state changes momentarily it becomes difficult to keep an eye on every single that has occurred inside the object of a system.

You might also like