Inheritance in logical modeling

Overview

Entities can extend other entities (Inheritance). An entity (child) can be based on another entity (parent).
For example, the PersonParty and OrganizationParty entities inherit from the Party entity.
They share all the attributes of their parent but have specificities.

Using inheritance

When inheritance is used:

  • The child entity inherits the following elements: Attributes, Unique Keys, Validations, Enrichers and References.

  • Matchers and Survivorship Rules are not inherited

  • It is not possible to modify the entity type. The child inherits from the parent entity type.

  • It is possible to add elements to the child entity: Attributes, Unique Keys, Validations, Enrichers and References.

  • The underlying physical tables generated for the child entities and parent entity are the same. They contain a superset of all the attributes in the cluster of entities.

  • Deleting an inherited attribute on a child entity removes it from the parent entity, and by extension from all the child entities inheriting this attribute from the parent.

  • You cannot modify the entity inheritance from the Entity editor and must use the Alter Entity option.

  • With entities inheriting attributes from a parent and having additional attributes, you can order and delete (non-inherited) attributes from the entity’s Inherited Attributes (All) section. It is not possible to order additional attributes before the inherited attributes. It is not possible to delete inherited attributes.

Inheritance limitations and recommendations

Although inheritance looks like a good way to avoid repeating design artifacts on entities that look the same, the interest of inheritance is frequently counterbalanced by certain limitations:

  • Navigating through references defined on a parent (abstract) entity cannot differentiate the type of the inheriting entities. As reference navigation frequently mandates differentiating these entities, designers tend to create references directly on the inheriting entities, eliminating the benefits of inheritance.

  • Records from two entities inheriting from the same abstract parent entity cannot be matched. For example, if creating a AbstractOrganization abstract entity, then two inheriting PrivateOrganization and PublicOrganization entities, you cannot create a matcher that looks for duplicates between PrivateOrganization and PublicOrganization.

  • SemQL does not give you access to the type of the instance you are currently manipulating, and does not provide, from the abstract entity, access to the inheriting entities' attributes. As a consequence, you cannot aggregate rules at the abstract level.

  • Multiple inheritance, that is an entity inheriting from multiple abstract parents, is not supported.

Due to these limitations, using inheritance reduces the capability of a model to evolve on the long run. It is not recommended to use inheritance unless you have a full understanding of these limitations.

Experience shows that a simpler approach using a single entity that holds all attributes, along with conditions to run rules or customize UI artifacts, brings the similar benefits and greater flexibility to the model. This approach is recommended in most cases instead of inheritance.