CS 3430 Lecture Notes - Lecture 23: Salary, Multiple Inheritance

31 views6 pages
77
Database Systems 3430 Chapter 4
Chapter 4: Enhanced Entity-Relationship (EER) Modeling
Warm up question: what is the purpose of superclass, subclass and inheritance concepts in OOP
programming languages such as Java?
EER Model Concepts
Includes all modeling concepts of basic ER
Additional concepts:
subclasses/superclasses
specialization/generalization
categories (UNION types)
attribute and relationship inheritance
Constraints on Specialization/Generalization
Subclasses/Superclasses
To model more accurately, we may need to define sub-groups for an entity;
For example EMPLOYEE could be grouped into:
SECRETARY, ENGINEER, TECHNICIAN, MANAGER, etc.
Based on their jobs
SALARIED_EMPLOYEE, HOURLY_EMPLOYEE
Based on the EMPLOYEE’s method of pay
EER diagrams extend ER diagrams to represent these subgroups, called subclasses.
Each of SECRETARY, ENGINEER, TECHNICIAN, … is a subclass of EMPLOYEE.
EMPLOYEE is the superclass for each of these subclasses
Some instances of EMPLOYEE could belong to more than one subclasses:
A salaried employee who is also an engineer. Subclasses are:
ENGINEER
SALARIED_EMPLOYEE
A salaried employee who is also an engineering manager, belongs to the three
subclasses:
MANAGER
ENGINEER
SALARIED_EMPLOYEE
An entity instance that is member of a subclass inherits
All attributes of the superclass.
All relationships of the superclass.
Example:
SECRETARY (as well as TECHNICIAN and ENGINEER) inherit the attributes Name, SSN, …,
from EMPLOYEE.
SECRETARY, TECHNICIAN and ENGINEER inherit WORKS_FOR relationship from
EMPLOYEE.
Unlock document

This preview shows pages 1-2 of the document.
Unlock all 6 pages and 3 million more documents.

Already have an account? Log in
78
Database Systems 3430 Chapter 4
Specialization
Specialization is the process of defining a set of subclasses for a superclass;
It is based upon some distinguishing characteristics:
Such as job type:
{SECRETARY, ENGINEER, TECHNICIAN} is a specialization of EMPLOYEE.
Another specialization of EMPLOYEE based on method of pay is
{SALARIED_EMPLOYEE, HOURLY_EMPLOYEE}.
EER diagrams could represent specialization;
Subclasses might have special attributes, called specific or local attributes.
For example, TECHNICIANs have technician_grade or ENGINEERs have
engineer_type.
A subclass can also participate in specific relationship types. MANAGER is a subclass of
EMPLOYEE.
Example: MANAGER manages a PROJECT.
Specialization in EER
There are different types of specializations:
1. Disjoint specialization (d) : a vehicle is a car XOR a truck.
2. Overlapping (non-disjoint) specialization (o): a superclass instance could belong to more than
one subclasses.
3. Attribute defined
specialization. Whenever
subclass membership is
determined by an attribute
value.
What is defining attribute
in this specialization?
Unlock document

This preview shows pages 1-2 of the document.
Unlock all 6 pages and 3 million more documents.

Already have an account? Log in

Document Summary

Includes all modeling concepts of basic er: additional concepts: subclasses/superclasses specialization/generalization categories (union types) attribute and relationship inheritance, constraints on specialization/generalization. To model more accurately, we may need to define sub-groups for an entity; Secretary, engineer, technician, manager, etc: based on their jobs. Salaried_employee, hourly_employee: based on the employee"s method of pay. Eer diagrams extend er diagrams to represent these subgroups, called subclasses. Each of secretary, engineer, technician, is a subclass of employee. Employee is the superclass for each of these subclasses. Some instances of employee could belong to more than one subclasses: a salaried employee who is also an engineer. Salaried_employee: a salaried employee who is also an engineering manager, belongs to the three subclasses, manager. Salaried_employee: an entity instance that is member of a subclass inherits, all attributes of the superclass, all relationships of the superclass. Secretary (as well as technician and engineer) inherit the attributes name, ssn, , from employee.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents