Section 5.10. Collaboration Diagrams

   

5.10 Collaboration Diagrams

Collaboration diagrams and sequence diagrams (discussed in the following section) are the two ways of representing interaction between different classes in UML. Objects in a system interact in order to provide the services defined by the application. Interaction diagrams represent objects in relation to one another.

In a collaboration diagram, objects are represented by rectangles. You draw arrows representing messages between each object. Each arrow is labeled to indicate the nature of the message and the order in which the message is sent.

5.10.1 When to Use Collaboration Diagrams

Use collaboration diagrams early in designing your system so that you can have a picture of how objects will interact. This can help you to refine your understanding of each aspect of the system. Perhaps you will find things that can be trimmed from the design because of redundancy, or more often, things that can be abstracted up to change the definition of your classes. A collaboration diagram is shown in Figure 5.3.

Figure 5.3. Collaboration diagram.

graphics/05fig03.gif

The diagram can be used to represent objects in the real world and their spatial relation to one another, and give you an overview that emphasizes the relationship of your system to things in the real world, which is a nice advantage. A chief criticism of collaboration diagrams, however, is that they can't represent very complex operations. This is a general criticism about all graphical systems of representation, really. Once you have more than a few objects, it can quickly get very difficult to read them. This forces you into partial representations of your system that are continued elsewhere.

Collaboration diagrams are generally the third item you create, after user scenarios and use cases.


   
Top


Java for ColdFusion Developers
Java for ColdFusion Developers
ISBN: 0130461806
EAN: 2147483647
Year: 2005
Pages: 206
Authors: Eben Hewitt

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net