UML Collaboration Diagrams
3. Collaboration Diagrams
A collaboration diagram is a graphical representation which shows the linkage between a number of objects and the links between them. Collaboration diagrams show the messages that are passed from one object to another. Since both collaboration diagrams and object sequence diagrams can express similar constructs, we can opt to use one over the other. We shall mainly discuss and use collaboration diagrams. As an example, collaboration diagram for "makePayment(cashTendered)" operation for the POST system is shown in Figure 4.1
Figure 4.1: A Collaboration Diagram for makePayment(cashTendered) Operation
While in comparison with the object sequence diagram for "makePayment(cashTendered)" operation for the POST system we can have as shown in Figure 4.2.
Figure 4.2: A Object Sequence Diagram for makePayment(cashTendered) Operation
Both of the two diagrams represent the following pseudo program
- POST accepts a call of it method makePayment() (from an Interface Object);
- POST calls for the method makePayment() of :Sale;
- Sale calls the constructor of class Payment to create a new:Payment