Defining Relations
In this part of the tutorial, you are going to define the necessary relations between the classes of your Network model.
UML
aggregations are recognized as ownership relations in Rogue Wave® Server while simple
associations are seen as use relations. (We will consider only oriented relations.)
For each relation, you will define:
the direct
role name
the inverse role name
the multiplicity of the inverse role
You will define the following relations:
A network owns domains.
Domains own nodes.
Domains also own lines.
A line uses a node as its input and the inverse relation is
outputLines.
A line uses a node as its output and the inverse relation is
inputLines.
To create the first relation, do the following:
1. Select the Aggregation button
in the main toolbar.
2. Drag a line from the Domain class to the Network class.
3. On the direct role (near the Domain class), open the contextual menu with the right mouse button, select “Role name” and type the role name: domains
4. On the direct role, select Multiplicity>0..* from the contextual menu.
5. On the inverse role (near the Network class), select “Role name” from the contextual menu and type the role name: network.
This role will be recognized as the inverse relation.
6. On the inverse role, select Multiplicity>1 from the contextual menu.
7. Repeat the same actions to define each relation.
Use the Unidirectional Association button
to create the relations between classes
Line and
Node.
You should obtain the following model:
Figure 7.4 Network Object Model with Completed Relations
The next step consists in defining member functions.
Version 5.7
Copyright © 2013, Rogue Wave Software, Inc. All Rights Reserved.