Sie sind auf Seite 1von 7

Learning Outcomes

Limitations of the basic ER modeling

CSC3064
Database Engineering

Model information through the use of EER diagrams


using UML
EER data modeling concepts

Lecture 4 EERM

Limitations of ER Modeling

Enhanced ER Modeling
Semantic concepts are incorporated into the original ER model and

Basic concepts of ER modelling are not sufficient to


represent requirements of newer, more complex
applications

called the Enhanced Entity-Relationship (EER) model


Most useful additional data modelling concept of Enhanced ER (EER)

model is called specialisation/ generalisation using UML

Response is development of additional semantic


modelling concepts

EER still incorporates much of the same designing concepts when

modelling an organisations database system. Eg, Entities (class),


relationships, attributes (characteristics), multiplicity, etc but with
enhanced features to reflect true real-world semantics. It focuses on
true normalisation rules!

Specialization/Generalization

Superclass and Subclass

Specialisation
Process of maximising differences between members of
an entity by identifying their distinguishing
characteristics. This is a top-down approach of
identifying lower-level entities.

Superclass
An entity type that includes one or more distinct

sub groupings of its occurrences. Eg, University


Staff

Generalisation
Process of minimising differences between entities by
identifying their common characteristics. This is a
bottom-up approach of identifying higher-level entities.

Subclass
A distinct sub grouping of occurrences of an

entity type. Eg, Clerk, Lecturer, Sr Lecturer,


Administration Staff, Security Guard, etc

Associations with entities

Superclasses and subclasses and the process of attribute


inheritance

Specialization

Generalization
Several classes with common features are generalized into a

Specialization is the process of defining a set of


subclasses of a superclass

superclass;
original classes become its subclasses
Example: CAR, TRUCK generalized into VEHICLE;
both CAR, TRUCK become subclasses of the superclass
VEHICLE.
We can view {CAR, TRUCK} as a specialization of VEHICLE
Alternatively, we can view VEHICLE as a generalization of CAR
and TRUCK

The set of subclasses is based upon some distinguishing


characteristics of the entities in the superclass
Example: {SECRETARY, ENGINEER, TECHNICIAN} is a
specialization of EMPLOYEE based upon job type.

May have several specializations of the same superclass

Specialization/Generalization

Generalization

Specialization/Generalization

10

CLIENT with Subtype Entities

An entity in a subclass

represents the same real world


object as in superclass eg, the
entity in the subclass is the same
entity in the superclass, but has
distinct role(s) or attributes
Superclass/subclass relationship
is one-to-one (1:1)
Superclass may contain
overlapping or distinct
subclasses (see previous slide)
Not all members of a superclass

need be a member of a subclass.


(see previous slide)

11

12

Attribute Inheritance

Subclasses and Super classes

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.
Subclass entities inherit all common attributes from the

superclass, eg, name, address, salary, etc


Use to avoid describing different types of staff with possibly

different attributes within a single entity.

13

All staff relation/table holding details of


staff

15

14

EER with shared subclass

16

Constraints on Specialization/Generalization

When to use EER

Participation constraint
Determines whether every member in superclass must
participate as a member of a subclass.
May be mandatory or optional.

Avoids describing similar concepts more than once,

therefore saving designers time and making ERM more


readable

Adds more semantic (real-world) information to the

(similar to using the I (mandatory) and O (optional) symbol in basic ER)

Disjoint constraint (only applies when superclass has many

design

subclasses)

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} or nondisjoint {And}.

Communicates significant semantic content in a concise

form

17

18

Displaying an attribute-defined specialization in


EER diagrams

19

20

Constraints on Specialization and Generalization

Constraints on Specialization and Generalization

Disjointness Constraint:
Specifies that the subclasses of the specialization must be
disjoint:

an entity can be a member of at most one of the subclasses of


the specialization

Specified by d in EER diagram


If not disjoint, specialization is overlapping:

that is the same entity may be a member of more than one


subclass of the specialization

Completeness Constraint:
Whether an instance of a supertype must also be a
member of at least one subtype
Total specialization rule yes (double line)
Partial allows an entity not to belong to any of the
subclasses
Shown in EER diagrams by a single line

Specified by o in EER diagram

21

Examples of completeness constraints

22

Examples of completeness constraints (cont.)


b) Partial specialization rule

a) Total specialization rule

A patient must be either


an outpatient or a
resident patient

A vehicle
could be
a car, a
truck, or
neither

Constraints on Specialization and Generalization


Hence, we have four types of
specialization/generalization:
Disjoint, total
Disjoint, partial
Overlapping, total
Overlapping, partial
Note: Generalization usually is total because the
superclass is derived from the subclasses.

25

Das könnte Ihnen auch gefallen