Académique Documents
Professionnel Documents
Culture Documents
EER Modeling
Sub classes, Super classes and Inheritance Specialization and Generalization Constraints and Characteristics of Specialization and Generalization Modeling of UNION Types Using Categories
Specialization
The process of defining a set of subclass of an entity type (the super class of the specialization). The set of subclasses that form a specialization is defined on the basis of some distinguishing characteristics of the entities in the super class.
{SECRETARY, ENGINEER, TECHNICIAN} is a specialization of EMPLOYEE based on the job type of each entity.
Specialization (cont.)
The same entity type may have several specializations based on different distinguishing characteristics. The EMPLOYEE entity type may have two specializations:
Based on the methods of pay: {SALARIED_EMPLOYEE, HOURLY_EMPLOYEE} Based on the type of job: {SECRETARY, ENGINEER, TECHNICIAN}
Specific attributes
Specific attributes
E1
E2
Example
EMPLOYEE d
MANAGER
HOURLY_EMP
SECRETARY
TECHNICIAN
ENGINEER
SALARIED_EMP
MANAGES
BELONGS_TO
PROJECT
TRADE_UNION
Specialization
The specialization process allows us to do the following: Define a set of subclass of an entity type Establish additional specific attributes with each subclass Establish additional specific relationship types between each subclass and other entity types or other subclasses
8
Generalization
Generalization is the reverse of specialization process. It defines a generalized entity type from the given entity types.
Generalization (cont.)
NoOfPassengers MaxSpeed VehicleID LicensePlateNo NoOfAxies Tonnage VehicleID LicensePlateNo
CAR
Price
TRUCK
Price
VehicleID
Price
LicensePlateNo
VEHICLE
NoOfPassengers MaxSpeed
CAR
NoOfAxies
TRUCK
Tonnage
10
Generalization (cont.)
We can view {CAR, TRUCK} as a specialization of VEHICLE Alternatively, we can view VEHICLE as a generalization of CAR and TRUCK
11
Generalization (cont.)
Generalization suppresses the difference among several entity types, identifying their common features, and generalize them into a single super class of which the original types are special sub classes.
The decision as to which process, generalization or specialization, is more appropriate in a particular situation is often subjective.
12
Constraints on Specialization/Generalization
Disjoint vs. Overlap Constraints A total specialization vs. a partial specialization Specialization/Generalization hierarchies and lattices Utilizing specialization and generalization in Conceptual Data Modeling
13
Disjointness Constraint
Disjoint(d) constraint specifies that the sub classes of the specialization must be disjointed (an entity can be a member of at most one of the subclasses of the specialization)
14
Example
Name SSN BirthDate Address EMPLOYEE
TypeSpeed
EngType
PayScale
TGrade
Salary
SECRETARY
TECHNICIAN
ENGINEER
SALARIED_EMP
HOURLY_EMP
Disjoint subclasses
Disjoint subclasses
15
Overlap Constraint
Overlap(o) specifies that the subclasses are not constrained to be disjoint, i.e., the same (real-world) entity may be a member of more than one subclass of the specialization. Overlap is the default constraint and displayed by placing an o in the circle.
16
Completeness constraint
Completeness constraint may be total or partial. A total specialization constraint specifies that every entity in the super class must be a member of some subclass in the specialization. Represented by a double line connecting the super class to the circle.
17
18
19
21
23
COMPANY
U
LienOrRegular PurchaseDate OWNS N CModel CMake CStyle VehicelId CYear TMake TYear REGISTERED_VEHICLE TModel Tonnage VehicleId
24
OWNER M
U
TRUCK
CAR
An entity that is a member of OWNER must exist in only one of the super class. Attribute inheritance works more selectively in the case of categories.
e.g., each OWNER entity inherits the attributes of a COMPANY, a PERSON, or a BANK, depending on the super class to which the entity belongs.
25
A category Or A Specialization
The superclass of a category may have different key attributes. If a category is total (not partial), it may be represented alternatively as a specialization, and the choice of which representation to use is subjective.
28
name
Aggregation
Used when we have to model a relationship involving (entity sets and) a relationship set.
Aggregation allows us to treat a relationship set as an entity set for purposes of participation in (other) relationships.
ssn Employees
lot
Monitors
until
since did
Sponsors
Aggregation vs. ternary relationship: y Monitors is a distinct relationship, with a descriptive attribute. (i.e., until) y Also, can say that each sponsorship is monitored by at most one employee.