Collaboration diagrams

[BRJ99] defines a collaboration diagram as "an interaction diagram that emphasizes the structural organization of the objects that send and receive messages; a diagram that shows interaction organized around instances and their links to each other." An example of a collaboration diagram is shown in Figure 6-9.

6: displayData ->

6: displayData ->

Figure 6-9. Example of a collaboration diagram.

In a collaboration diagram, all the messages that start at an object and the ones that end at an object are shown. As shown in Figure 6-9, messages selectWeatherStation, selectTimelnterval, and getWeatherData start from object farmer. Message displayResults starts and ends at object GUI.

Messages that end at an object show that the behavior of this object should be designed to provide answers for the received messages. Therefore, collaboration diagrams help design class behavior. From the collaboration diagram presented in Figure 6-9, class GUI should, at the least, provide behavior for selecting a weather station, selecting a time interval, and to get the weather data from the source used.

0 0

Post a comment