Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Mastering UML with Rational Rose 2002.pdf
Скачиваний:
137
Добавлен:
02.05.2014
Размер:
9.68 Mб
Скачать

Chapter 5: Object Interaction

Add white crew socks to cart (between Cart Mgr and Cart Items)

Figure 5.25: Collaboration diagram

Summary

In this chapter, we have discussed one of the most versatile concepts in UML: Interaction diagrams. Object Interaction diagrams show how objects work together in order to implement the functionality of a use case. There are two types of Interaction diagrams: Sequence diagrams and Collaboration diagrams. Both of these show the same information, just from different perspectives.

Sequence diagrams show the flow of control through time. A Sequence diagram is created for each alternative path through a use case. They are useful for viewing the functionality as a use case progresses.

Collaboration diagrams show the flow of control, but not across time. Collaboration diagrams illustrate the relationships between objects and show messages between objects. From a Collaboration diagram, a system designer can see which objects may be bottlenecks or discover which objects need to directly communicate with each other. Collaboration diagrams can also show data flows between objects; Sequence diagrams do not have this capability. Through Rose, Sequence diagrams and Collaboration diagrams are interchangeable. When a change is made on one, the corresponding diagram changes as well.

Typically, each Interaction diagram goes through a two−pass approach. In the first pass, most of the technical details are left off of the diagrams. These diagrams can be shown to the users who can verify that the process is captured correctly. Once the first−pass diagrams have been validated, the second−pass diagrams can be created. The audience of the second−pass diagrams is not the users, but the project team, including the designer, developers, and analysts. The second pass incorporates many details into the Interaction diagrams. Each object of the diagrams is mapped to a class. Each message on the diagrams is mapped to an operation of a class. Model−quality reports can be generated to show any unmapped objects or messages.

After completing the second−pass Interaction diagrams, some classes that the system requires have been created in Rose. In the next chapter, we will discuss how to create the class diagrams that developers use to actually develop classes.

200