Tips to spot subtypes and supertypes

Tips to spot subtypes and supertypes

Adding supertypes and subtypes to your logical data model (LDM) helps improve communication, enforce additional rules, and organize thought. Sometimes however, it is not always apparent where to add a supertype to store the common attributes and relationships of subtypes, or where to add subtypes to store subtype-specific attributes and relationship.

There are some tricks though to spot opportunities on an LDM to add subtypes and supertypes.

For example, if there is an entity with a high number of null attributes, there is a good chance subtypes might be needed, as in this Student entity:

studentbeforesubtype2

We can add subtypes to make many more attributes required (not null):

studentaftersubtypes5

Initially we knew very little about a student, but after he/she applies, we now know their application date, phone number, and email, so all three of these attributes can now be not null. Once the student is enrolled, we learn more about the student so we can require the date he/she enrolled, whether he/she is receiving financial aid, and their address. Once the student graduates, we require their graduation date.

Now with subtypes the model enforces more rules and communicates much more.

There are other ways to spot opportunities for subtypes and supertypes. I will continue to add to this list, feel free to comment and add your own ways too!

 

2 Comments

  1. Georgia Prothero 3 years ago

    Hi Steve, another reason is to be able to show that a ‘child’ entity can only be joined to ‘parent’ entities of a certain type. For example: StudentClass only joins to EnrolledStudent, not all Students.

  2. Eugene Kats 3 years ago

    Steve,

    I also would say that Super Type / Sub Type is much easier to understand for business people. I always try to use this type of structure in my Logical Data Model. One of the samples would be Customer as Super Type and Company and Individual as Sub Type. They have so much different attributes.

Leave a reply

Your email address will not be published. Required fields are marked *

*