Uniqueness Constraints on Objectified Associations

Unlike UML and some ER versions, ORM currently allows a fact type to be objectified only if it either has a spanning uniqueness constraint or is a 1:1 binary fact type. This article argues that this restriction should be relaxed, and replaced by a modeling guideline that allows some n-ary associations to be objectified even if their longest uniqueness constraint spans n-1 roles. The pros and cons of removing this restriction are discussed, and illustrated with examples. Introduction In this article, the terms “relationship type”, “association”, and “fact type” all denote typed predicates (e.g. Person plays Sport). In many business domains, it is perfectly natural to think of certain relationship instances as objects about which we wish to talk. This process of making an object out of a relationship is called objectification (also known as reification, or nesting), and is supported by Object-Role Modeling (ORM) [3, 4, 5] and the Unified Modeling Language (UML) [6]. This article assumes basic familiarity with these modeling approaches. The ORM schema in Figure 1(a) objectifies the fact type Person plays Sport as Play, which is then used as an object type in the fact type Play is at SkillLevel. The latter fact type is said to be nested, as it nests another fact type inside it. The exclamation mark “! ” appended to “Play” indicates that Play is independent, so instances of Play may exist without participating in other fact types. This is consistent with the optional nature of the first role of Play is at SkillLevel. Figure 1(b) depicts the same example in UML. Here the skill level fact type is represented as an optional attribute on the association class Play. Person Sport “Play ! ” plays SkillLevel is at Person Sport * * skillLevel [0.1] Play (a) (b) Figure 1 Objectifying an association with a spanning uniqueness constraint in (a) ORM and (b) UML. Popular, industrial versions of Entity Relationship (ER) Modeling typically provide little or no support for objectification. However, academic versions of ER often provide partial or full support for objectification (e.g. see [1]). As an example of partial support, some ER versions allow objectified relationships to have attributes but not to play in other relationships. Notice that the objectified association Person plays Sport has a spanning uniqueness constraint. In early versions of ORM, no association could be objectified unless it had a spanning uniqueness constraint. Later, I relaxed that restriction, to allow binary 1:1 associations to be objectified [2]. Currently, ORM allows no other uniqueness constraint patterns on objectified associations. In particular, ORM forbids the following two kinds of associations to be objectified: (1) An n:1 (or 1:n) binary association (2) A ternary or longer association whose longest uniqueness constraint spans exactly n-1 roles. We exclude from consideration any n-ary association whose longest uniqueness constraint spans fewer than n-1 roles, because such an association is compound rather than elementary. Compound associations can be split into smaller associations without information loss, so may lead to redundancy problems if used as