The Extended ER Diagram
by K. Yue
1. Introduction
- The basic ER model is too simplistic for many applications.
- Furthermore, the concept of entity is not as well defined as class. It may be regarded as somewhat object-based, but not object-oriented.
- Results: all kinds of extensions.
- Be careful when you use these extensions.
- Many versions
- Some conflicting
2. Extensions
- Most of these extensions are based on the object-oriented model.
- As you use more and more of them, consider using an OO modeling language.
- EA-RA model: relationship may have attributes.
Example:
Drawn using https://www.draw.io/:
- Most ER extension provides for attributes for relationships.
Example:
An ER diagram using Chen's notation.
OO Extensions:
- Generalization and specialization: Superclass and subclass. Two key concepts:
- Model 'a-kind-of' relationship.
- Generalization can be Used to minimize redundant definitions of members and relationships in the subclasses.
- Note that many use the term subclass, subtype or sub-entity in a similar manner. They are not entirely the same.
- I assume that you are somewhat familiar with the generalization and specialization concept.
- When shall we use it?
Example: Figure of Hoffer:
- Property of disjointness of subclasses:
- disjoint: an object cannot belong to two subclasses at the same time.
- overlapping: an object can belong to two subclasses at the same time.
- Beware of overlapping subclasses. Recommendation: avoid overlapping subclass in ER modeling.
Example:
Three entities, person, faculty and student (Figure 7.4 of Ricardo) are modeled as superclass and subclass. What is an alternative model?
- Completeness of specialization: a superclass object must be an object of one of the subclasses: total specialization.
- In general, complete and disjoint specialization is preferred.
Example:
Figure 7.2 of Ricardo. Give an example of a partial specialization.
- Multiple inheritance: in general, do not use it.
Example:
Figure 7.4 of Ricardo. What do you think about TA being a subclass of both faculty and student?
- In general, beware of ambiguity in English.
Examples:
John has a car.
A car has an engine.
A man is a person.
A man is a kind of a person.
A student is a person.