Chapter 14: Capturing How Objects Collaborate


Overview

In This Chapter

  • Structuring a communication diagram

  • Numbering your messages

  • Conquering concurrency with communication diagrams

  • Capturing the design of a collaboration

To get a job done, you design interactions among a set of participating objects so that they can work together to achieve your goal. UML gives you several tools to work out the details of these interactions, such as sequence diagrams, communication diagrams, activity diagrams, and timing diagrams. If you follow the diagramming guidelines given in Chapter 11 (along with the techniques of this chapter), you’ll be using communication diagrams when it’s necessary to design the details of an interaction.

 UML2   Communication diagrams are not really new to UML 2, but their name is new. In the previous UML 1.x versions, these diagrams are called collaboration diagrams, because they show how objects collaborate to meet a goal. While this was a good name, UML also uses collaboration to mean something else. In UML 2, a collaboration is a specification of how a set of objects and associations playing specific roles realize an operation or use case. Therefore, with the old terminology, a collaboration diagram was just one way of indicating the details of one scenario that a collaboration was realizing. Confusing? You bet. So, the UML gurus finally decided to change the name to communication diagrams.

In UML 2, when you attempt to design a collaboration (the set of classes and associations that realize a use case or an operation), you’ll need to specify the participating objects and links. Then, for each possible scenario that the use case or operation has, you must specify the interaction of messages among the participating objects and links in the collaboration.

To do this, you’ll need one or more interaction diagrams to capture these scenarios. Sequence diagrams will probably suffice for many circumstances, but as you move into detailed design, you may find the capabilities of communication diagrams more suitable to your needs.

 Warning   While the new UML 2 communication diagrams look a lot like the old UML 1.x collaboration diagrams, they seem to be significantly less complicated, and unfortunately, less expressive and powerful. In this chapter, we offer advice on how to regain some of the lost expressiveness, while still keeping you from drowning in details. We’ve asked the UML 2 team at OMG to re-insert some of the features they’ve taken out for the sake of compatibility and power. You’ll need to keep track of future revisions to UML 2 (perhaps UML 2.1) to see exactly how they’ve done the corrections.




UML 2 for Dummies
UML 2 For Dummies
ISBN: 0764526146
EAN: 2147483647
Year: 2006
Pages: 193

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