07 Enhanced ERD
07 Enhanced ERD
Enhanced ER-Model
1 www.pktutorials.com
Enhanced Entity-Relationship Model:
2 www.pktutorials.com
Enhanced Entity-Relationship Model:
3 www.pktutorials.com
Specialization / Generalization:
▪ Superclass
▪ An entity type that includes one or more distinct subgroupings of
its occurrences, which require to be represented in a data model
▪ Subclass
▪ A distinct subgrouping of occurrences of an entity type, which
require to be represented in a data model
▪ For example, the Staff superclass may have subclasses as Manager,
SalesPersonnel, and Secretary etc.
4 www.pktutorials.com
Specialization / Generalization:
5 www.pktutorials.com
Specialization / Generalization:
6 www.pktutorials.com
Specialization / Generalization:
7 www.pktutorials.com
Specialization / Generalization:
8 www.pktutorials.com
Specialization / Generalization:
▪ There are two important reasons for introducing the concepts of
superclasses and subclasses into an ER model.
▪ Firstly, it avoids describing similar concepts more than once,
thereby saving time for the designer and making the ER diagram
more readable.
▪ Secondly, it adds more semantic information to the design in a
form that is familiar to many people e.g., the assertions that
‘Manager IS-A member of staff’ and ‘flat IS-A type of property’,
communicates significant semantic content in a concise form.
9 www.pktutorials.com
Specialization / Generalization:
▪ Attribute Inheritance
▪ An entity in a subclass represents the same ‘real world’ object
as in the superclass, and may possess subclass-specific
attributes, as well as those associated with the superclass.
▪ A subclass is an entity and so it may also have one or more
subclasses
10 www.pktutorials.com
Specialization / Generalization:
▪ Attribute Inheritance
▪ An entity and its subclasses and their subclasses, and so on, is
called a type hierarchy.
▪ Type hierarchies are known by a variety of names including:
▪ Specialization hierarchy
▪ Generalization hierarchy
▪ IS-A hierarchy
11 www.pktutorials.com
Specialization / Generalization:
▪ Specialization
▪ The process of maximizing differences between members of an
entity by identifying their distinguishing characteristics.
▪ Specialization is a top-down approach to defining a set of
superclasses and their related subclasses.
▪ The set of subclasses is defined based on some distinguishing
characteristics of the entities in the superclass.
12 www.pktutorials.com
Specialization / Generalization:
13 www.pktutorials.com
Diagrammatic Representation:
▪ The subclasses are attached by lines to a triangle that points toward
the superclass.
▪ The label below the specialization/generalization triangle, shown as
{Optional, And}, describes the constraints on the relationship
between the superclass and its subclasses.
▪ Attributes that are specific to a given subclass are listed in the lower
section of the rectangle representing that subclass.
▪ Attributes that are common to all subclasses are listed in the lower
section of the rectangle representing the superclass.
14 www.pktutorials.com
Specialization / Generalization:
▪ Generalization
▪ The process of minimizing differences between entities by
identifying their common characteristics.
▪ Generalization is a bottom-up approach , that results in the
identification of generalized superclass from the original entity types.
▪ Identify similarities between entities, such as common attributes and
relationships.
▪ It can be viewed as the reverse process of specialization.
15 www.pktutorials.com
Specialization / Generalization:
16 www.pktutorials.com
Specialization / Generalization:
17 www.pktutorials.com
Generalization
▪ The process of extracting common features from a set of entities and creating
generalized entities from it
▪ Bottom-up approach: two or more entities are combined to form a higher-level entity if
they have some standard features
▪ Subclasses are combined to form a superclass
▪ Example:
superclass vehicle
Bottom-up
subclass car motorcycle bus approach
18
Specialization
▪ An opposite process of generalization
▪ An entity is broken down into subclasses based on some standard features (attributes)
▪ Top-down approach: Identify a subset of an entity set that shares some common
characteristics
▪ Example: a vehicle can be a truck, car or bus
20 www.pktutorials.com
Constraints: Specialization / Generalization:
▪ Disjoint constraint
▪ Describes the relationship between members of the subclasses
and indicates whether it is possible for a member of a superclass
to be a member of one, or more than one, subclass.
▪ The disjoint constraint only applies when a superclass has more
than one subclass.
▪ If the subclasses are disjoint, then an entity occurrence can be a
member of only one of the subclasses.
21 www.pktutorials.com
Constraints: Specialization / Generalization:
▪ Disjoint constraint
▪ To represent a disjoint superclass/subclass relationship, ‘Or’ is
placed next to the participation constraint within the curly
brackets e.g., contract of employment:
specialization/generalization is disjoint, which means that a
member of staff must have a full-time permanent or a part-time
temporary contract, but not both.
22 www.pktutorials.com
Constraints: Specialization / Generalization:
▪ Disjoint constraint
▪ If subclasses of a specialization/generalization are not disjoint
(called nondisjoint), then an entity occurrence may be a member
of more than one subclass.
▪ To represent a nondisjoint superclass/subclass relationship, ‘And’
is placed next to the participation constraint within the curly
brackets.
▪ For example, the job role specialization/ generalization is
nondisjoint, which means that an entity occurrence can be a
member of both the Manager, and SalesPersonnel subclasses
(shared subclass SalesManager).
23 www.pktutorials.com
Constraints: Specialization / Generalization:
Disjoint constraint
▪ Note that it is not necessary to include the disjoint constraint
for hierarchies that have a single subclass at a given level and
for this reason only the participation constraint is shown for
the SalesManager and AssistantSecretary subclasses.
24 www.pktutorials.com
Categories: Disjoint / Participation:
25 www.pktutorials.com
Dream Home Branch View:
26 www.pktutorials.com
Dream Home Branch View:
27 www.pktutorials.com
Dream Home Branch View:
28 www.pktutorials.com
29 www.pktutorials.com
Aggregation:
▪ Represents a ‘has-a’ or ‘is-part-of’ relationship between entity types, where
one represents the ‘whole’ and the other the ‘part’
▪ A relationship represents an association between two entity types that are
conceptually at the same level
▪ One entity represents a larger entity (the ‘whole’), consisting of smaller
entities (the ‘parts’)
▪ Aggregation does not change the meaning of navigation across the
relationship between the whole and its parts, nor does it link the lifetimes of
the whole and its parts e.g. the Has relationship, which relates the Branch
entity (the ‘whole’) to the Staff entity (the ‘part’)
30 www.pktutorials.com
Aggregation:
31 www.pktutorials.com
Aggregation:
32 www.pktutorials.com
Composition:
▪ A specific form of aggregation that represents an association
between entities, where there is a strong ownership and
coincidental lifetime between the ‘whole’ and the ‘part’.
▪ The ‘whole’ is responsible for the disposition of the ‘parts’,
which means that the composition must manage the creation
and destruction of its ‘parts’.
▪ In other words, an object may only be part of one composite at
a time.
33 www.pktutorials.com
Composition:
34 www.pktutorials.com
Important:
35 www.pktutorials.com
THANKS
36 3/30/2024 www.pktutorials.com