The Extended ER Diagram
by K. Yue
1. Introduction
- How do we select a modeling language? Three important criteria (there are many):
- Simplicity
- Expressiveness
- Basic model
- Using these metrics to rate ER and UML:
- Simplicity: ER simpler
- Expressiveness: UML more expressive
- Basic model
- UML: object-oriented model
- ER: somewhat object-oriented (more like object-based).
- Thus, you can imagine the basic ER model is too simplistic for many applications.
- 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:
See: https://en.wikipedia.org/wiki/Entity%E2%80%93relationship_model
OO Extensions:
- Generalization and specialization: Superclass and subclass. Two key concepts:
- Model 'a-kind-of' relationship.
- Do not use 'is-a' relationship to reason about it.
- Generalization can be Used to minimize redundant definitions of members and relationships in the subclasses.
- I assume that you are familiar with the generalization and specialization concept.
- When shall we use it?
Example: Figure 7.2 of Ricardo.
- 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.
- Generalization and specialization allows inheritance of members of a superclass by subclasses. It is not the only way in OOD. For example, GOLANG does not support inheritance.
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.
Bun is a person.