Skip to content

Generalization(Inheritance) when ER Modelling using Crow’s Feet Notation.

December 5, 2012

I have been looking into how to show generalization when modelling a database using Crows Feet notation and came into some difficultly. Generalization in terms of a database is when one table has all of the fields of another table. Another way of explaining would be saying one table is extended from another. For example the tables Supervisor and SalesAssistant both contain all of the fields in the Employee table. How this is actually implemented in the database is another story, at the entity relationship modelling stage we are just defining relationships between tables and generalization is just one form of possible relationship.

So I have found three ways of modelling this relationship in Crow’s Feet which left me rather bambuzzled as to which one I should actually use. I will now show the three methods I have found.

Method 1

Any UML(Unified Modelling Language) modelers will know this notation as it is exactly the same. An non filled arrow is placed with the point touching the ‘superclass’ object and all classes that inherit from this class(subclass) are linked to this arrow by a black line. This is the same notation as used when doing any modelling in UML.

Notation 1

UML Notation can also be used in Crow’s Feet for Generalization with a slight difference in defining Participation and Carndinality.

Method 2

The second method is mentioned in a few text books and is rather neat and represents literally what the relationship describes. A large rectangle showing the name of the superclass is drawn. Within that rectangle any subclasses will appear. This shows that the subclasses are a type of the superclass and are in effect encapsulated which is the desired outcome at this modelling stage. Other relationships can either link to the subclasses or the superclass.

In the box notation for ER diagramming using Crow's Feet

Box in box notation for ER diagramming using Crow’s Feet

Method 3

The third method is similar to UML again however the arrow and text is replaced with an icon that indicates the relationships completeness and disjointness.

Like UML except without the arrowhead and with a symbol to indicate participation and cardinality.

Like UML except without the arrowhead and with a symbol to indicate participation and cardinality.

All of these method are valid in a Crow’s Feet diagram because in the early days of this notation, people developed their own extensions to the notation. UML was created to avoid this by providing a standard of modelling for everyone to follow and that everyone can understand. Of these methods my favorite is the box in box method as it is neat and adequately models the actual relationship. However there seem to be limited documentation about this, Textbooks state this is how it should be used but don’t show how to model the participation and cardinality constraints. I would suggest a UML based notation to show the constraints.

Next blog post will be about my introduction to making a Single Page Web App using Ajax, Javascript and jQuery.

Andrew

Advertisements

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: