Rules defines the object types as well as their relations. A "rule" links two types together in a type relation. The term "type" denotes the abstract type of an object whereas a "relation" represents the nature of a parental connection between two types.
The terms rule and type are often used interchangeably, for instance, by "defining a type" we actually mean defining a new rule for a type and by "deleting a type" we actually mean removing a given rule. However, the actions are not strictly identical: defining a new rule does not always involve the creation of a new type (while the opposite is true) and the removal of a rule does not always lead to the complete removal of a type.
Relations
In a hierarchical typing system like
With respect to the parent type, a type relation can be defined as:
- An element relation, the child type being a simple component of its parent.
- A generic flow, either an input or an output or both. However, flow object instances must be defined as either input or output (they cannot be both except in the case of bidirectional flows).
- A bidirectional flow, both an input and an output.
The rules linking types must follow certain guidelines:
- Type names are unique, consequently different types must have different names.
- The types can be recursive, directly or indirectly (meaning that a type S can contain the type S).
- The relations between types are independent, therefore:
- A type Bottle can have a child type Water as an object (and not as a flow).
- A type Pipe can have the same child type Water as a flow.
Flow Relations
When a relation is defined as a flow, the direction of the flow is defined when instances of the type within the relation are created.
The following pages will show you how to work with types and rules: