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!