Collaboration diagram what is




















As the number of objects and messages grows, the diagram becomes increasingly hard to read. In addition, it is difficult to show additional descriptive information such as timing, decision points, or other unstructured information that can be easily added to the notes in a sequence diagram.

You can have objects and actor instances in collaboration diagrams, together with links and messages describing how they are related and how they interact.

The diagram describes what takes place in the participating objects, in terms of how the objects communicate by sending messages to one another. You can make a collaboration diagram for each variant of a use case's flow of events. A collaboration diagram that describes part of the flow of events of the use case Receive Deposit Item in the Recycling-Machine System.

An object is represented by an object symbol showing the name of the object and its class underlined, separated by a colon:. You can use objects in collaboration diagrams in the following ways: An object's class can be unspecified.

Normally you create a collaboration diagram with objects first and specify their classes later. The objects can be unnamed, but you should name them if you want to discriminate different objects of the same class.

An object's class can itself be represented in a collaboration diagram, if it actively participates in the collaboration. Actors Normally an actor instance occurs in the collaboration diagram, as the invoker of the interaction. If you have several actor instances in the same diagram, try keeping them in the periphery of the diagram. The sequence diagram captures the interaction between the objects in the context of collaboration. Sequence diagrams are time focused and they show the order of the interaction visually by using the vertical axis of the diagram to represent time.

Example: Collaboration Diagram represents the interaction of the objects to perform the behavior of a particular use case or a part of use case. The designers use the Sequence diagram and Collaboration Diagrams to define and clarify the roles of the objects that perform a particular flow of events of a use case.

Skip to content. Change Language. Related Articles. Looking for Work? Contact Us. Dark Kimbie. Published in:. Collaboration diagrams allow you to see both the dynamic aspects and static relationships of business objects in a single diagram. Why use Collaboration Diagrams? From Sequence Diagram to Collaboration Diagram In reality, sequence diagrams and collaboration diagrams show the same information, but just present it differently.

Figure 1: A sequence diagram is ideal for showing the time-ordering of messages during an object interaction. Figure 2: A collaboration diagram is best suited for showing the relationships between objects involved in a collaboration. Collaboration Diagram Elements There are three primary elements of a collaboration diagram: Objects Links Messages Objects Objects participating in a collaboration come in two flavors?

Collaboration diagrams are so closely related to sequence diagrams that some modeling tools can automatically generate one type of diagram from the other. Links The connecting lines drawn between objects in a collaboration diagram are links. Figure 3: Associations specified in a class diagram can be represented as links in a collaboration diagram. However, you can also specify the following adornments for links to indicate how objects are associated: Global the object is visible as a global variable Local the object is visible as a local variable Parameters the object is visible as a parameter Self represents the ability of an object to send a message to itself Messages Messages in collaboration diagrams are shown as arrows pointing from the Client object to the Supplier object.

For example, in the collaboration diagram in Figure 2 , you can follow the sequence numbers to determine the order of messages between objects: 1. Enter Borrower ID 1. Iterating and Conditional Messages Collaboration diagrams use syntax similar to sequence diagrams to indicate that either a message iterates is run multiple times or is run conditionally.

Creation and Deletion of Objects Unlike sequence diagrams, you don't show an object's lifeline in a collaboration diagram. Collaboration vs.

Sequence Diagrams As you follow the sequence of messages in Figure 2 , you can definitely see why the time-ordering of messages is not the strong suit of collaboration diagrams! Creating a Collaboration Diagram When you create a Collaboration diagram, you should place the most important objects involved in the collaboration in the middle of the diagram.

When designing collaboration diagrams from scratch versus generating them automatically from sequence diagrams , here are the basic steps to follow: Determine the scope of the diagram. As with sequence diagrams, the scope of a collaboration diagram can be a use case. Place the objects that participate in the collaboration on the diagram. Remember to place the most important objects towards the center of the diagram.

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. Create links between the objects. Create messages associated with each link. Add sequence numbers to each message corresponding to the time-ordering of messages in the collaboration.

Objects Changing State As mentioned in the previous section, you can also adorn objects with properties to indicate their initial state as well as any change in state. Figure 4: If an object changes significantly during an interaction, you can add a new instance of the class to the diagram and show its changed state. Summary Although collaboration diagrams are not used as often as sequence diagrams, they are a very useful part of the UML. This article was published in:.

Have additional technical questions? We use cookies to make this site work properly. For more information, see our Privacy Policy. Do you agree to us using cookies? Sure, I know how this works! Get me out of here!



0コメント

  • 1000 / 1000