0% found this document useful (0 votes)
5 views

Chapter 4

Uploaded by

bilelignsisay
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Chapter 4

Uploaded by

bilelignsisay
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Chapter 4

Enhanced E-R
(EER) Models
 Object-oriented extensions to E-R model
 EER is important when we have a relationship between
two entities and the participation is partial between
entity occurrences. In such cases EER is used to reduce
the complexity in participation and relationship
complexity.
 ER diagrams consider entity types to be primitive
objects
 EER diagrams allow refinements within the structures
of entity types
 EER Concepts
 Generalization
 Specialization
 Sub classes
 Super classes
 Attribute Inheritance
 Constraints on specialization and generalization
 Generalization
 Generalization occurs when two or more entities represent
categories of the same real-world object.
 Generalization is the process of defining a more general
entity type from a set of more specialized entity types.
 A generalization hierarchy is a form of abstraction that
specifies that two or more entities that share common
attributes can be generalized into a higher level entity
type.
 Is considered as bottom-up definition of entities.
 Generalization hierarchy depicts relationship between
higher level super class and lower level subclass.
Generalization hierarchies can be nested. That is, a subtype
of one hierarchy can be a super type of another. The level of
nesting is limited only by the constraint of simplicity.

Example: Account is a generalized form for saving


and Current Accounts
 Specialization
 Is the result of subset of a higher level entity set to form a
lower level entity set.
 The specialized entities will have additional set of
attributes (distinguishing characteristics) that distinguish
them from the generalized entity.
 Is considered as Top-Down definition of entities.
 Specialization process is the inverse of the
Generalization process. Identify the distinguishing
features of some entity occurrences, and specialize them
into different subclasses.
 Reasons for Specialization
o Attributes only partially applying to super classes
o Relationship types only partially applicable to the
super class
 In many cases, an entity type has numerous sub-
groupings of its entities that are meaningful and need to
be represented explicitly. This need requires the
representation of each subgroup in the ER model. The
generalized entity is a super class and the set of
specialized entities will be subclasses for that specific
Super class.
o Example: Saving Accounts and Current Accounts are
Specialized entities for the generalized entity
Accounts. Manager, Sales, Secretary: are specialized
employees.

 Subclass/Subtype
 An entity type whose tuples have attributes that
distinguish its members from tuples of the generalized or
super class entities.
 When one generalized Super class has various subgroups
with distinguishing features and these subgroups are
represented by specialized form, the groups are called
subclasses.
 Subclasses can be either mutually exclusive (disjoint) or
overlapping (inclusive).
 A single subclass may inherit attributes from two distinct
super classes.
 A mutually exclusive category/subclass is when an entity
instance can be in only one of the subclasses.
E.g.: An EMPLOYEE can either be SALARIED or PART-
TIMER but not both.
 An overlapping category/subclass is when an entity
instance may be in two or more subclasses.
E.g.: A PERSON who works for a university can be
both EMPLOYEE and a STUDENT at the same
time.

 Super class /Super type


 An entity type whose tuples share common attributes.
Attributes that are shared by all entity occurrences
(including the identifier) are associated with the super
type.
 Is the generalized entity

 Relationship Between Super class and


Subclass
 The relationship between a super class and any of
its subclasses is called a super class/subclass or
class/subclass relationship
 An instance can not only be a member of a
subclass. i.e. Every instance of a subclass is also
an instance in the Super class.
 A member of a subclass is represented as a
distinct database object, a distinct record that is
related via the key attribute to its super-class
entity.
 An entity cannot exist in the database merely by
being a member of a subclass; it must also be a
member of the super-class.
 An entity occurrence of a sub class not
necessarily should belong to any of the
subclasses unless there is full participation in the
specialization.
 The relationship between a subclass and a Super
class is an “IS A” or “IS PART OF” type.
 Subclass IS PART OF Super class
 Manager IS AN Employee
 All subclasses or specialized entity sets should be
connected with the super class using a line to a
circle where there is a subset symbol indicating
the direction of subclass/super class relationship.

 We can also have subclasses of a subclass


forming a hierarchy of specialization.
 Super class attributes are shared by all
subclasses of that super class
 Subclass attributes are unique for the subclass.

 Attribute Inheritance
 An entity that is a member of a subclass inherits
all the attributes of the entity as a member of the
super class.
 The entity also inherits all the relationships in
which the super class participates.
 An entity may have more than one subclass
categories.
 All entities/subclasses of a generalized entity or
super class share a common unique identifier
attribute (primary key). i.e. The primary key of
the super class and subclasses are always
identical.

 Consider the EMPLOYEE super type entity shown


above. This entity can have several different
subtype entities (for example: HOURLY and
SALARIED), each with distinct properties not shared
by other subtypes. But whether the employee is
HOURLY or SALARIED, same attributes (Employee,
Name, and Date Hired) are shared.
 The Super type EMPLOYEE stores all properties that
subclasses have in common. And HOURLY
employees have the unique attribute Wage (hourly
wage rate), while SALARIED employees have two
unique attributes, Stock Option and Salary.

Constraints on specialization and


generalization
 Completeness Constraint.
 The Completeness Constraint addresses the issue of
whether or not an occurrence of a Super class must also
have a corresponding Subclass occurrence.
 The completeness constraint requires that all instances of
the subtype be represented in the super type.
 The Total Specialization Rule specifies that an entity
occurrence should at least be a member of one of the
subclasses. Total Participation of super class instances on
subclasses is diagrammed with a double line from the
Super type to the circle as shown below.

E.g.: If we have EXTENTION and REGULAR as subclasses of


a super class STUDENT, then it is mandatory that each
student to be either EXTENTION or REGULAR student.
Thus the participation of instances of STUDENT in
EXTENTION and REGULAR subclasses will be total.

 The Partial Specialization Rule specifies that it is not


necessary for all entity occurrences in the super class to be a
member of one of the subclasses. Here we have an optional
participation on the specialization. Partial Participation of
super class instances on subclasses is diagrammed with a
single line from the Super type to the circle.

E.g.: If we have MANAGER and SECRETARY as subclasses


of a super class EMPLOYEE, then it is not the case that
all employees are either manager or secretary. Thus
the participation of instances of employee in
MANAGER and SECRETARY subclasses will be partial.
 Disjointness Constraints.
 Specifies the rule whether one entity occurrence can
be a member of more than one subclasses. i.e. it is a
type of business rule that deals with the situation
where an entity occurrence of a Super class may also
have more than one Subclass occurrence.
 The Disjoint Rule restricts one entity occurrence of
a super class to be a member of only one of the
subclasses. Example: a EMPLOYEE can either be
SALARIED or PART-TIMER, but not the both at the
same time.
 The Overlap Rule allows one entity occurrence to
be a member f more than one subclass. Example:
EMPLOYEE working at the university can be both a
STUDENT and an EMPLOYEE at the same time.
 This is diagrammed by placing either the letter "d"
for disjoint or "o" for overlapping inside the circle on
the Generalization Hierarchy portion of the E-R
diagram.

The two types of constraints on generalization and


specialization (Disjointness and Completeness
constraints) are not dependent on one another. That is,
being disjoint will not favour whether the tuples in the
super class should have Total or Partial participation for
that specific specialization.

From the two types of constraints we can have four


possible constraints

 Disjoint AND Total

 Disjoint AND Partial


 Overlapping AND Total

 Overlapping AND Partial

You might also like