Lecture 2b - EER Modeling
Lecture 2b - EER Modeling
Lecture 2b - EER Modeling
Sampath Jayarathna
Cal Poly Pomona
Subclasses and Superclasses (1)
• Examples:
• A salaried employee who is also an engineer belongs to the
two subclasses:
• ENGINEER, and
• SALARIED_EMPLOYEE
• A salaried employee who is also an engineering manager
belongs to the three subclasses:
• MANAGER,
• ENGINEER, and
• SALARIED_EMPLOYEE
Representing Specialization in EER Diagrams
Attribute Inheritance in Superclass / Subclass
Relationships
• An entity that is member of a subclass inherits
• All attributes of the entity as a member of the superclass
• All relationships of the entity as a member of the superclass
• Example:
• In the previous slide, SECRETARY (as well as TECHNICIAN and ENGINEER)
inherit the attributes Name, SSN, …, from EMPLOYEE
• Every SECRETARY entity will have values for the inherited attributes
Specialization (1)
• Specialization is the process of defining a set of subclasses of a superclass
• The set of subclasses is based upon some distinguishing characteristics of
the entities in the superclass
• Example: {SECRETARY, ENGINEER, TECHNICIAN} is a specialization of EMPLOYEE
based upon job type.
• Example: MANAGER is a specialization of EMPLOYEE based on the role the
employee plays
• May have several specializations of the same superclass
Specialization (2)
Predicate-defined
Attribute-defined
Constraints on Specialization and Generalization