Lecture 03 Enhanced ERD
Lecture 03 Enhanced ERD
http://www.agilemodeling.com/artifacts/classDiagram.htm
Inheritance: UML
● Inheritance defines a subclass relationship
○ A subclass inherits all properties (members) of the superclass
● This is the perspective
of most modern programming languages
Set Theoretic View of Inheritance
● B ⊂ A, C ⊂ A everything true about a member
● Every B is also an A
● Every C is also an A of a set is also true about any
member of its subsets.
all entities
A
B C
EER IsA Notation
Phone
Name PERSON
ID
IsA
STUDENT PROFESSOR
Phone
Name PERSON
ID
STUDENT PROFESSOR
Phone
Name PERSON
ID
STUDENT PROFESSOR
Phone
Name PERSON
ID
STUDENT PROFESSOR
Every mouse
must be sold with
a computer? TRUE
Every computer
must be sold with
a mouse? FALSE
Constraints on Inheritance
all entities
A
B C
Overlapping Subsets
● B ⊂ A, C ⊂ A an entity may be in both B and C
● B∩C=∅
overlapping = non-disjoint
all entities
A
B C
Covering Subsets
● B ⊂ A, C ⊂ A every entity in A is also in B or C
● B∪C=A
all entities
A
B C
Non-Covering Subsets
● B ⊂ A, C ⊂ A some entities in A are not in B or C
● B∪C=A
all entities
A
B C
Inheritance Constraint Notation
● Subset notation,
A A
IsA o
B C B C
Disjoint, Non-covering
● Every A can also be a B or a C or but not both
A A
disjoint
IsA d
B C B C
Non-disjoint, Covering
● Every A must be a B or a C or both
A A
covering
IsA o
B C B C
Disjoint, Covering
● 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
Comparison
A A
d ∪
B C B C