Enhanced Entity-Relationship Model

last updated 09-Sep-2018

Entity Type Hierarchies

One entity type might be a subtype of another--very similar to subclasses in OO programming

A relationship exists between a Freshman entity and the corresponding Student entity

This relationship is called IsA

 


Properties of IsA

Inheritance - All attributes of the supertype apply to the subtype.

Transitivity - This property creates a hierarchy of IsA relationships

Advantage: Used to create a more concise and readable E-R diagram.  It best maps to object oriented approaches either to databases or related applications.

Any of the entity or sub-entity can participate in a relationship as appropriate.

 


Example of IsA

 


Type Hierarchy

These associated constraints may apply to IsA hierarchies:

Covering constraint: Union of subtype entities is equal to set of supertype entities. An entity is an element of at least one subtype

Disjointness constraint: Sets of subtype entities are disjoint from one another (i.e., the sets are mutually exclusive). An entity can be an element of at most one entity

If not disjoint then we may say the subentites can overlap

 

 

 


Specialization Abstraction

Specialization-needed when an entity set has subsets that have additional attributes or that participate in special, separate relationships

Process of breaking up a class into subclasses

Ex: Faculty contains AdjunctFac and FullTimeFac

Specialization can be total (every member of superclass must be in some subclass) or partial

 

 


Representing Specialization

The circle is another symbol for IsA

E-ER diagram –shows specialization circle (IsA relationship), and inheritance symbol (subset symbol)

Specialization can also involve just one subclass – no need for circle, but show inheritance symbol

The sub-entities are most likely invoking the disjointedness constraint

 


Generalization Abstraction

Inverse of specialization

Recognizing that classes have common properties and identifying a superclass for them

Ex. Student and Faculty are both people

Bottom-up process, as opposed to top-down process of specialization

Probably the covering constraint applies, but not disjointedness.

EER diagram is similar for specialization

s

 

 


Multiple Specializations

Can have different specializations for the same class

See undergraduates specialized by year and by residence. These are independent of each other

Can have shared subclasses – have multiple inheritance from two or more superclasses

 


Union or Category

Subclass related to a collection of superclasses

Each instance of subclass belongs to one, not all, of the superclasses

Superclasses form a union or category

Ex. A Sponsor may be a team, a department, or a club –

Each Sponsor entity instance is a member of one of these superclasses, so Sponsor is a subclass of the union of Team, Dept, Club

EER diagram - connect each superclass to union circle, connect circle to subclass, with subset symbol on line bet circle and subclass

 

 


Total and Partial Unions

Total category – every member of the sets that make up the union must participate

Shown on E-ER by double line from union circle to subset

See below every Concert or Fair must be a Campus-Wide Event

Partial category – not every member of the sets must participate

Shown by single line

See below-- not every Club, Team, or Dept must be a Sponsor

 


Total Union vs. Specialization

Total union can often be replaced by hierarchy

Choose hierarchy representation if superclasses have many common attributes

 


(min..max) Notation for Relationships

Shows both cardinality and participation constraints

Can be used for both E-R and E-ER diagrams

Use pair of integers (min..max) on line connecting entity to relationship diamond

min is the least number of relationship instances an entity must participate in

max is the greatest number it can participate in (can write M or N for many); some authors use * for many