Where used: Classification Model, Composition Model, Mapping Model, Object Type And Relation Model


Read First: Object Type
Read Next: Place, Place Relation, Mapping, Relation Mapping

Loosely speaking, a relation is for connecting things.  For example, the
relation Marriage joins two people.  The following aspects of relations
are necessary to define them completely:

  1) Participating types

         The types of things that a relation may connect are called the
         participating types.  For example, in most states the
         participating types of Marriage are men and women.

  2) Participant cardinality

         The numbers of things of each type in he relation can be
         restricted by the participant cardinality.  For example,
         marriage can be restricted to relating one man and one woman.

  3) Tuple cardinality

         The number of times the same object can participate in a
         relation is called the tuple cardinality (pardon the name).
         For example, a man can be restricted to participating in most
         one marriage at the same time.

  4) Role types

         The types of things that a relation actually does connect at
         any given time are called the role types.  For example, those
         objects that are actually connected in the Marriage relation at
         this particular moment are of type Wife and Husband.  See
         discussion at hasRoleType/isRoleTypeFor

The above information is recorded in two ways: using places or
place relations.  See descriptions there.

Relation as Object Type

Formally in OOIE, a relation is a kind of object type that has the
joined things as objects.  For example, the relation Marriage is an
object type where particular pairs of people, like (Mary, John), are its
objects. A relation can connect any number of things.  For example, the
Gives relation has a giver, receiver, and gift.  For this reason, the
instances of a relation are called tuples (derived from duple, triple,
and quadruple).  A tuple of the Gives relation might be (Mary, John,
GoneWithTheWind) to say that Mary gave John the book GoneWithTheWind. By
comparison, the tuples of Marriage have only two elements, like example,
(Mary, John).  The number of elements that a relation requires of its
tuples is called the arity (derived from binary and ternary).

Specialized Relations

Like all object types, relations can be specialized by reducing the
number of tuples they have as instances (see
specializes/generalizes). There are two ways to do this:

    1) Specialize the participating types.  For example, if we have a
       Drives relation between cars and drivers, a specialization can be
       made by restricting the drivers to race car drivers and the cars
       to race cars.

    2) Specialize the relation itself using any of the three techniques
       described at specializes/generalizes.  For example, we could make
       a specialization of marriages by restricting the range of one of
       its mappings, like requiring the license be issued in California
       to model Californian marriages.

You can combine the above techniques.  For example, you can restrict
participants for race-car driving at the same time you give it
particular properties, like disregarding peed limits.

Naming Specialized Relations

A confusing aspect of specialized relations is that we always use the
same name for them as we do for their generalizations.  In the driving
example above, we still call the relation Drive when it involves a race
car, even though it is a very different kind of driving, as well as
having its participating types restricted to race cars and race car
drivers. Specialized object types, on the other hand, always get a
different name than their generalizations.  So when you see the same
relation on an object type and its specialization, check for new
features and restricted participants on the inherited relation.

Implementing Relations

Relations do not define any particular computation, so cannot be used
directly for implementation.  They must be translated to mappings, the
basic unit of computation, at design time.  See discussion at Mapping.

Interoperability with OMT

OMT sometimes has more than one name for a relation (see page 14, figure
7 of the Notation Summary, version 0.8) .  This can be handled by adding
a meta-attribute to relation for each kind of name.


See the summary with example at Place Relation. 

Relations are mistakenly called "Association" in LiveModel.  Association
in OOIE means any connection between objects, including relations,
mappings, and specialization.

Read First: Object Type
Read Next: Place, Place Relation, Mapping, Relation Mapping


Attributes: None

Operations: None