Referential Integrity

The referential integrity of the instances of a server object model relies on a set of rules that are specific to a given application. In other words, the referential integrity is maintained as long as the object structure conforms to these rules. For example, in our network management application, we might consider that the integrity is maintained as long as each node has at least one incoming or outgoing line, and each line connects two nodes. If one of these rules is not respected, the referential integrity is violated.

Server provides you with a predefined cut function that transparently maintains the global integrity of your object model. The default behavior of the cut function, described in the next section, can be redefined to meet your specific needs. You do not need to invert relations to be able to use the cut function, since this function uses internal data.

The cut Function

When a cut is performed on a server object, this event is propagated upwardly and recursively to the origin of the relation. This function applies both to the users and to the owner of an object, that is, to the object(s) that owns or uses the cut object.

In the Network example, the relation between a domain and lines is a list relation: a domain owns several lines. According to the rules defined for our server object model, a node must always have at least one incoming or outgoing line, otherwise, this node will be cut.

As a consequence, if a cut is performed on Node 2, all the relations with this node will be broken and all the lines coming to, or going from, this node will also be cut.

This behavior is illustrated by the following figures, which show how Server helps maintain part of the object model integrity.

lines Relation cut as a Consequence of cut on Node 2

When there is an attempt to violate the minimum cardinality of a list, the origin is also cut. Otherwise, the list loses an element.

In the figure below, the list has no minimal cardinality, so it merely loses items and the relation to the origin object remains untouched.

Line Objects cut as a Consequence of the cut on the lines Relation

In the figure below, the minimum cardinality is reached. Therefore, the origin is also cut.

Domain Origin Object cut Because Minimal Cardinality Reached