Chapter 4 EER
Chapter 4 EER
Diagrams
REVIEW
Extended Entity-Relationship Model
adds Inheritance
indicates that one entity type is
an extension of another entity type
often referred to as an IS-A relationship
http://www.agilemodeling.com/artifacts/classDiagram.htm
Inheritance defines a subclass relationship
A subclass inherits all properties (members) of the super class
This is the perspective of most modern
programming languages
B ⊂ A, C ⊂ A everything true about a member
Every B is also an A of a set is also true about any
Every C is also an A member of its subsets.
all entities
A
B C
Phone
Name PERSON
ID
IsA
STUDENT PROFESSOR
STUDENT PROFESSOR
STUDENT PROFESSOR
STUDENT PROFESSOR
Every mouse
must be sold with
a computer? TRUE
Every computer
must be sold with
a mouse? FALSE
Disjointness: an entity can be
a member of at most one subtype
a person may be a student or may be a professor, but not both
all entities
A
B C
an entity may be in both B and C
overlapping = non-disjoint
all entities
A
B C
B ⊂ A, C ⊂ A every entity in A is also in B or C
B ∪ C = A
all entities
A
B C
some entities in A are not in B or C
all entities
A
B C
IsA (triangle) notation:
Subset notation,
A A
IsA o
B C B C
Every A can also be a B or a C or but not both
A A
disjoint
IsA d
B C B C
Every A must be a B or a C or both
A A
covering
IsA o
B C B C
Every A must be a B or a C, but not both
A A
disjoint,
IsA d
covering
B C B C
disjoint, covering inheritance:
every car is a vehicle
every truck is a vehicle
every vehicle is either a car or a truck
no vehicle is both a car and a truck
disjoint, non-covering inheritance:
employees may be secretaries, technicians or
engineers, but not more than one of these
non-disjoint, covering inheritance:
every part is a manufactured part,
or a purchased part,
or both (a purchased, manufactured part)
OWNER
B and C are subtypes of A A is a subtype of B∪C
B⊂A
B⊂A A ⊂ B∪C
B∪C ⊂ A
A A
d ∪
B C B C