05 - The Enhanced Entity-Relationship Model PDF
05 - The Enhanced Entity-Relationship Model PDF
05 - The Enhanced Entity-Relationship Model PDF
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
University of Indonesia
IKI2024 - Database 1
Term 1 - 2011/2012
Lecturer:
Satrio Baskoro Yudhoatmojo, S.Kom., M.T.I.
1
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
University of Indonesia
2
Acknowledgement
3
Outline
4
Why We Need an Enhanced ER?
• So far, ER has been useful to model a
‘traditional’ database (database processing
application for business and other common
industries)
• Since the late 70’s, the necessity for designing
schema for representing a more accurate
data properties and constraints, especially for
emerging application in several fields (CAD,
CAM, GIS, etc), is considered necessary.
• This necessity cause for a new development
semantic data modeling concepts to be
added to the existing ER model.
5
The Enhanced Entity- Relationship (EER) Model
6
EER Model Concepts
• EER model includes all modeling concepts of
the ER model
• In addition, EER includes:
✤ Subclasses and superclasses
✤ Specialization and generalization
✤ Category or union type
✤ Attribute and relationship inheritance
• Type inheritance
✤ Subclass entity inherits all attributes and
relationships of superclass
10
Specialization
• Specialization
✤ Process of defining a set of subclasses of an entity type
✤ Defined on the basis of some distinguishing
characteristic of the entities in the superclass
Disjoint Subclass
symbol
13
Specialization
14
Benefits of Specialization
15
Generalization
• Generalization
✤ Process of defining a generalized entity type
from the given entity types
✤ By identifying entity types that have similar
attributes
✤ For example: TRUCK & CAR could be
generalized into VEHICLE
16
Example of Generalization
17
Constraints and Characteristics of Specialization and
Generalization
18
19
Constraints on Specialization and Generalization
22
Hierarchies and Lattices
• Specialization hierarchy
✤ Every subclass participates as a subclass in only one
class/subclass relationship
✤ Results in a tree structure or strict hierarchy
✴ For example:VEHICLE with TRUCK and CAR
• Specialization lattice
✤ Subclass can be a subclass in more than one class/
subclass relationship
✤ For example: a Engineering Manager must be an
Engineer and also a Manager
✤ Has a multiple inheritance concept
23
24
25
Hierarchies and Lattices
• Multiple inheritance
✤ Subclass with more than one superclass
✤ If an attribute (or relationship) originating in
the same superclass inherited more than once
via different paths in a lattice
✴ Included only once in a shared subclass
• Single inheritance
✤ Some models and languages limited to single
inheritance
26
Utilizing Specialization and Generalization in Refining
Conceptual Schemas
• Specialization process
✤ Start with entity type then define subclasses
by a successive specialization
✤ Top-down conceptual refinement
process
27
Modeling of UNION Types Using Categories
29
Set Union
Operation
INSTRUCTOR_RE
SEARCHER is a
union subclass of
FACULTY and
GRAD_STUDENT
Category
30
Differences between Category and Lattice
32
Total Category
• Holds all entities in
its superclass
• For example: A
building and a lot
must be a member of
PROPERTY
• It can be represent
by a generalization
(d), especially if
there were a lot of
similarities.
33
Design Choices for Specialization/Generalization
34
Design Choices for Specialization/Generalization
35
Design Choices for Specialization/Generalization
36
Formal Definitions for the EER Model Concepts
• Class
✤ Set or collection of entities
✤ Includes any of the EER schema constructs of
group entities
• Subclass
✤ Class whose entities must always be a subset
of the entities in another class
• Specialization
✤ Set of subclasses that have same superclass
37
Formal Definitions for the EER Model Concepts
• Generalization
✤ Generalized entity type or superclass
• Predicate-defined
✤ Predicate on the attributes of is used to
specify which entities in C are members of S
• User-defined
✤ Subclass that is not defined by a predicate
38
Higher Degree Relationship
These two schemas
have different
meanings!
Three binary
relationship type:
CAN_SUPPLY,
USES, SUPPLIES
39
Higher Degree Relationship
• How to simplify this seemly complex higher
degree relationship?
40
Ternary Relationship as a Weak Entity Type
41
Ternary Relationship as Identifying Relationship Type
42
Ternary Vs. Binary Relationship Type
43
When Do We Use the EER Model?
• Most of database projects do not need the
object-oriented model features provided by
EER.
• The objective of conceptual data modeling
is to provide a simple and understandable
model.
• Do not use the complex class/subclass
relationship if it is not needed.
• The use of EER model offers benefits
compare to ER model if it were used in a
proper condition.
44
When Do We Use the EER Model?
• EER model needs to be use if the domain which
we are trying to model is naturally an object-
oriented domain, thus inheritance would be able
to reduce the complexity of the design.
• Use EER model in these situations:
✤ If the use of attribute inheritance is able to reduce
the use of null value in a single entity relation (the
one which contains multiple subclasses)
✤ A subclass can be use to explicitly modeled and
named a subset of an entity which participated in
its own relationship (where other subclass in the
same superclass is not participated in that
relationship)
45
Alternative Diagrammatic Notations
46
Summary
47