Denormalizing a Multi-type Relationship

A multi-type relationship can be used to combine separate entities when the sub-entities contain no or very few attributes. In this case, the super-entity and its sub-entities could be redefined as one Uniface entity that has a type code indicating the role of each occurrence in this redefined entity. Uniface subtypes can then be used to handle the subset of occurrences.

When the sub-entities have a few attributes and are denormalized into one Uniface entity, each occurrence has the corresponding fields. For each occurrence, the fields must be checked whether they are empty depending on the value of the type code field, as shown in the following illustration:

Denormalizing a Multi-type Relationship

Denormalizing a multitype relationship

Consider the Uniface entities PAID_INVOICE and UNPAID_INVOICE that result from translating the multi-type relationship for the INVOICE modeled entity . These Uniface entities have no fields (except for a primary key) because the original sub-entities had no attributes. Denormalizing this structure in the application model results in one Uniface entity INVOICE that has an additional type code field, PAID_TYPE (Boolean or Y/N) indicating whether an invoice is paid or unpaid. Uniface subtypes can be defined to handle the subset of paid or unpaid invoices.