Relationships

Related information is stored in separate business objects within the database. You define the relationships between the different business objects and then the application uses the relationships to find the associated information.

For example, suppose you want to phone a user with questions about a problem they logged. Users' phone numbers are recorded in the USER business object; problems are recorded in the PROBLEM business object. When you find the Problem that you are interested in, the system looks for the phone number based on the relationship between the two business objects. It does not store the phone number each time the user logs a problem – it stores it just once, on the related user business object.

Object and Collection relationships

There are two types of relationship:

Object relationship – in a relationship between the objects A and B, a relationship to A is created on object B, but there is no relationship to B on A

This is useful if you want to select a single value of A on the object B. For example, if you want to select a User on a Request.

Collection relationship – enables you to create many of the related objects on the core object, and to view the core object from any of the related objects: a relationship to A is created on object B, and a collection relationship to B is created on A

This is useful if you want to create many instances of the related object from the core object. For example, if you want to add Notes to a Request.

Avoid creating unbounded collections, as these adversely affect the performance of your system. Unbounded collections are those that are likely to continue to grow as the size of your database grows. For example, Incident-Notes is a bounded collection because Incidents are closed after a period of time, after which no further Notes can be added. However, a User-Incidents collection is unbounded because the number of objects in the collection grows as the number of Incidents logged for each user grows. If you want to view the incidents logged for each user, it is better to write a query.