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

Chapter 8: Relationships

Select Multiplicity → Zero or One from the shortcut menu.

8.

Repeat steps 4–7 to add the remaining multiplicity to the diagram, as shown in Figure 8.32.

Figure 8.32: Associations for the "Add Item to Shopping Cart" use case

9.

Right−click the unidirectional association between the CartCollection class and CartItem class, near the CartCollection class.

10.

Select Aggregate from the shortcut menu.

11.

Repeat steps 9 and 10 to add an aggregation between the ProductCollection class and Product class.

Summary

In this chapter, we discussed the different types of relationships in UML: associations, dependencies, aggregations, and generalizations. Each of these types of relationships can be added to a Rose model through a Class diagram.

Once the relationships have been added, you can add various details, such as relationship names, role names, qualifiers, and multiplicity. In the next chapter, we'll take a look at object behavior. We'll focus on a single class and examine the various states in which the class can exist and the ways the class transitions from one state to another.

340