Lecture 3
Lecture 3
4
Specialization / Generalization
Superclass
– An entity type that includes one or more
distinct subgroupings of its occurrences.
Subclass
– A distinct subgrouping of occurrences of an
entity type.
5
Specialization / Generalization
Superclass/subclass relationship is one-
to-one (1:1).
Superclass may contain overlapping or
distinct subclasses.
Not all members of a superclass need be
a member of a subclass.
6
Specialization / Generalization
Attribute Inheritance
– An entity in a subclass represents same ‘real
world’ object as in superclass, and may
possess subclass-specific attributes, as well
as those associated with the superclass.
7
Specialization / Generalization
Specialization
– Process of maximizing differences between
members of an entity by identifying their
distinguishing characteristics.
Generalization
– Process of minimizing differences between
entities by identifying their common
characteristics.
8
AllStaff relation holding details of all staff
9
Specialization/generalization of Staff entity
into subclasses representing job roles
10
Specialization/generalization of Staff entity into
job roles and contracts of employment
11
EER diagram with shared subclass and
subclass with its own subclass
12
Constraints on Specialization / Generalization
Two constraints that may apply to a
specialization/generalization:
– participation constraints
– disjoint constraints.
Participation constraint
– Determines whether every member in
superclass must participate as a member of
a subclass.
– May be mandatory or optional.
13
Constraints on Specialization / Generalization
Disjoint constraint
– Describes relationship between members of
the subclasses and indicates whether
member of a superclass can be a member of
one, or more than one, subclass.
– May be disjoint or nondisjoint.
14
Constraints on Specialization / Generalization
There are four categories of constraints of
specialization and generalization:
– mandatory and disjoint
– optional and disjoint
– mandatory and nondisjoint
– optional and nondisjoint.
15
DreamHome worked example - Staff Superclass
with Supervisor and Manager subclasses
16
DreamHome worked example - Owner Superclass with
PrivateOwner and BusinessOwner subclasses
17
DreamHome worked example - Person superclass
with Staff, PrivateOwner, and Client subclasses
18
19