Creating Subtype Cluster Relationships
Go Up to Working with Relationships
Note: Subtype cluster relationships can only be represented in the logical model. When the physical model is generated from a logical model, the subtype relationship is converted to identifying relationship.
A subtype cluster refers to a group of entities sharing similar characteristics that form a generalization hierarchy. In each subtype cluster, there is one parent entity, known as a supertype, and one or more subtype entities. The supertype generalizes a set of subtypes; the common characteristics of subtype entities are assigned to the supertype while the subtype entities have more specific attributes. The subtypes, also known as category entities, represent homogeneous subsets of the supertype. The attributes and relationships of the supertype entity are propagated to all of its subtypes. Discriminators, an attribute of the subtype, distinguish the entities in the subtype from each other.
Other than recognizing a generalization hierarchy, an important issue with subtyping is to decide how to implement a subtype cluster in the physical model. Sometimes it is best to project subtypes into the supertype, representing the entire cluster as a single, generalized entity. Other times, you may need the granularity of separate subtype entities, choosing to implement the subtypes and supertype one-for-one or rolling the supertype down into the subtypes.
During the logical model phase, you should search for hierarchies that can reveal a more general approach to aggregating attributes into entities. By addressing the general case, you can design a more flexible and extensible approach to storing data. The use of subtyping is a powerful tool in identifying and portraying such generalizations.
To illustrate the use of subtyping, let's take the example of the group of entities - Person, Customer, and Employee. Each entity stores information about employees. Accordingly, Person is the supertype in this example and the remaining entities can be grouped in a subtype. Any person contained in a subtype entity is also represented in Person. In each entity, the primary key is the Name. Because each entity instance for the entities in the subtype are also represented in the supertype, the relationships between the supertype entities and all subtype entities must be an identifying relationship, that is the customer, engineer and writer must all be employees. The relationship between Person, Customer, Employee, and Supplier is complete, because the business is concerned only with these types of persons. The relationship between the Employee, Engineer, and Writer is an incomplete subtype because there can be other employee types, such as quality assurance analysts.
In this example, the Person entity is the supertype. All Person's have a name, address and telephone number. A person can be either an Employee or a Customer. In addition to sharing name, address and telephone number attributes, each of these subtypes has its unique attributes; for example, an Employee has a Profession; and a Customer has a Credit Limit. An entity can be both a supertype and a subtype, as is the case with Employee, which can be further divided into Engineer and Writer.
- Click the Logical model.
- Choose Insert > Subtype Cluster and then choose Complete or Incomplete.
- Click an entity to designate it as the parent (supertype) and then click the entity (subtype) you want to add to the subtype cluster.
- Tip: You can add multiple entities to the subtype cluster by pressing CTRL while clicking the desired entities.
- Right-click to revert to the Selection tool and then double-click the newly created subtype relationship indicator.
- Complete the Subtype Cluster Editor as required and then click OK.
The following helps you complete the Subtype Cluster Editor options:
- Type: Select the subtype cluster type, Complete or Incomplete.
- Complete: A subtype cluster is complete when all possible subtype entities are included in the subtype cluster. An example of a complete subtype cluster is one in which Person is the supertype and Male and Female are the subtypes.
- Incomplete: Select if all possible subtype entities will not included be in the cluster. For example, a subtype cluster is made up of several entities, Employee, StoreManager, SalesPerson and StockPerson, each of which stores information about employees. In this example, Employee is the supertype and the remaining entities can be grouped in a subtype. This is probably an incomplete subtype cluster because other employee types cannot be represented in the cluster, such as security guards and cashiers.
- Membership Type: Select Inclusive or Exclusive subtype.
- Inclusive: Select if each supertype that has subtypes can be more than one subtype at a time. For example, an EMPLOYEE and be both an ENGINEER and a WRITER.
- Exclusive: Select if each supertype that has subtypes can be only one subtype at a time. For example, a PERSON cannot be both an EMPLOYEE and a CUSTOMER.
In IE notation, an exclusive subtype is represented with an exclusive OR symbol. The diagram and reports will show the type of supertype/subtype cluster in the TYPE field depending on what you selected, Complete, Inclusive; Complete, Exclusive; Incomplete, Inclusive; Incomplete, Exclusive.
- Discriminator: Select a discriminator from the list.A discriminator is an attribute that distinguishes each of the subtype entities from one another. A subtype discriminator can be a primary key or non-key attribute of the supertype. After you define a discriminator, ER/Studio Data Architect displays it next to its subtype cluster symbol.
Attachment Bindings tab
Bind an external piece of information, or attachment to the domain. You can also remove an attachment from an object, override an attachment binding's default value, or change the position of a bound attachment. To override the value of the attachment you have moved to the Selected Attachments grid, double-click the Value field of the target attachment. ER/Studio Data Architect opens the Value Override Editor or a list depending on the attachment datatype. Attachments are created in the Attachments folder of the Data Dictionary. For more information, see Attaching External Documents to the Data Model.
- You can add an entity to a subtype cluster by choosing Insert > Relationship > Identifying, clicking the subtype cluster symbol next to the supertype you want to associate the entity with, and then clicking the entity you want to add to the subtype cluster.
- You can edit the subtype by right-clicking the subtype cluster symbol and then selecting Edit Subtype Cluster.
- You can change the colors of the subtype cluster symbol, by right-clicking it and then selecting Subtype Cluster Color.
- You can remove an entity from a subtype by selecting the relationship between the subtype and the entity and then choosing Edit > Remove Relationship.
- You can delete a subtype if you no longer want to include it in your data model. You can also add or remove entities from a subtype cluster in much the same way you add or delete relationships between entities. Delete a subtype by selecting the subtype and then choosing Edit > Delete Subtype Cluster. Deleting a subtype cluster deletes all relationships between the parent entity (supertype) and the child entities (subtypes).
- You must redefine the relationships between the entities after you delete a subtype.
- While subtypes can be specified as complete or incomplete, you'll get a visual indication of it only in IDEF1X. To see the distinction in IE (Crow's feet) you can view it in the Subtype Cluster Editor, or use a naming convention or color as a mnemonic.
- IE is more flexible in supporting subtypes, permitting roll up (generalization) and roll down (specialization) transformations.