Relationships

Previous Next

A relationship is the implementation of an association or connection between instances of 2 entities or, occasionally, between instances of the same entity.

Example

The connection between an Order and the Customer who placed that Order.

 

 

collapseRelationships implement associations
expandCardinality

The purpose of Relationships is to implement certain types of association in a USoft application. Exactly how you map an association to USoft Tables, Columns and Relationships is a design choice that mainly depends on the association's cardinality.

For help on mapping cardinality to USoft Tables, Columns and Relationships, click here.

Cardinality is the number of times that an instance is allowed to play a part (or role) in an association. Cardinality is a separate issue for each "side" of the association:

MR_clip0049

A car rental branch may be located at an airport or at some different location. If the company does business from an airport, it only has a single branch there.

If you do not keep any Airport information other than the name, then Airport is said to be a property of Branch, rather than an entity in its own right.

MR_clip0050

Each customer has a name that must be registered. Each time a name is registered, this applies to a single person. Two customers could both be called "Smith", but if one of those names came to be changed in the application (to correct an error, or when the person actually changes his or her name in reality), then the change would apply only to that particular customer.

If you do not keep any family name information other than a customer's name, which is likely, then Name is said to be a property of Customer, rather than an entity in its own right.

MR_clip0051

Each customer registered in the application has placed 0, 1 or multiple orders. Each given order has been placed by a specific customer.

MR_clip0052

Each order contains 1 or more orderlines. A given orderline is part of exactly 1 order.

MR_clip0053

Contracts must be signed by at least one stakeholder (as long as it has not been signed, the document may not be registered as a contract), but there could be multiple stakeholders. Each stakeholder could be involved in multiple contracts.

collapseUSoft implements relationships as foreign keys
collapseUSoft generates navigation paths between related entities

 

 

See also

Mapping associations to Tables, Columns and Relationships

How to define a Relationship

Relationship attributes

The RELATE keyword

Domains

Tables

Columns

Logical Views

Supertypes and subtypes