Relationship Between Operating System of Server and Operating System of Workstation
This example shows how a constraint refers to the characteristics of two different objects to ensure the consistency of the assigned values.
The operating system for workstations must be OS1 if the operating system of the server is OS1:
Dependency net: C_net
Dependency: OS1_workstation
Source code:
OBJECTS:
Server is_a (300) c_server
WHERE server_os = c_operating_system,
Workstation is_a (300) c_workstation
WHERE workstation_os = c_operating_system,
Net is_a (300) c_net
CONDITION:
part_of (server, net) and part_of (workstation, net) and server_os = ‘OS1’
RESTRICTIONS:
Workstation_os = server_os
INFERENCES:
Workstation_os
The constraint refers to the objects server, workstation, and network. These objects are referred to by entering the classes to which they are allocated. The constraint also contains the characteristics to be compared by the constraint.
The condition defined for the constraint is that server and workstation must be part of a network (refer to
Constraints: Entering Conditions). Since class c_net is a superior class of classes company_network and department_network, the statements in the constraint affect both the company network and the department networks. This means that you do not need to create two different constraints for the company network and the department networks.Under RESTRICTIONS you define that the operating system of the workstation must be the same as the operating system of the server. Since you defined in the CONDITION section that the operating system of the server must be OS1, operating system OS1 must be inferred for the workstation.
Under INFERENCES you define that the operating system for workstations is to be inferred. This entry is for information only, because an equation under RESTRICTIONS automatically determines the values for the variable on the left-hand side of the equals sign (refer to
Restrictions).You link the dependency net containing this constraint to both the company network and the department network. This means that the constraint still takes effect if you sell a department network on its own.