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

Chapter 8: Relationships

Figure 8.29: Link element (association class)

To set a link element for the relationship:

1.

Open the desired relationship's specification window.

2.

Select the Detail tab.

3.

Set the link element using the Link Element field.

Using Constraints

A constraint is some condition that must be true. In Rose, you can set constraints for the relationship or for a single role. Any constraints you enter will be generated as comments in the generated code.

To set a relationship constraint:

1.

Open the desired relationship's specification window, as shown in Figure 8.30.

336

Chapter 8: Relationships

Figure 8.30: Relationship constraints

2.

Select the Detail tab.

3.

Enter constraints in the Constraints field.

To add constraints to a role:

1.

Open the desired relationship's specification window.

2.

Select the Role Detail tab for the desired role.

3.

Enter the constraints in the Constraints field, as shown in Figure 8.31.

337