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 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 direct role
-
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:
-
Select the Aggregation button in the main toolbar.
-
Drag a line from the Domain class to the Network class.
-
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
-
On the direct role, select Multiplicity>0..* from the contextual menu.
-
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.
-
On the inverse role, select Multiplicity>1 from the contextual menu.
-
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:
Network Object Model with Completed Relations
The next step consists in defining member functions.