Sunday, 3 October 2021

Generalization and Specialization in EER model

The basic principle of subtype / supertype relationships including the characteristics of good subtype. But in the real world data models you need to recognize opportunities to exploit these relationships. There are two process to do this - generalization and specialization - that serve as mental models in developing supertype/subtype relationships.

Generalization and specialization are two words for the same concept, viewed from two opposite directions. Generalization is the bottom-up process of defining a generalized entity type from a set of more specialized entity types. Specialization is the top-down process of defining one or more subtypes of a supertype.

1. Generalization 

Generalization is the process of minimizing the differences between entities by identifying common features. It can also be defined as the process of defining a generalized entity type from a set of entity types. 

The process of defining a more general entity type from a set of more specialized entity types.

 

An example of generalization is shown in above Figure, three entity types have been defined: CAR, TRUCK, and MOTORCYCLE. At this stage, the data modeler intends to represent these separately on an E-R diagram. However, on closer examination, we see that the three entity types have a number of attributes in common: Vehicle ID (identifier), Vehicle Name (with components Make and Model), Price, and Engine Displacement. This fact (reinforced by the presence of a common identifier) suggests that each of the three entity types is really a version of a more general entity type.

This more general entity type (named VEHICLE) together with the resulting supertype/subtype relationships is shown in below figure. The entity CAR has the specific attribute No Of Passengers, whereas TRUCK has two specific attributes: Capacity and Cab Type. Thus, generalization has allowed us to group entity types along with their common attributes and at the same time preserve specific attributes that are peculiar to each subtype.


2. Specialization

Specialization is a process of identifying subsets of an entity set (the superset) that share some distinguishing characteristics. In specialization the superclass is defined first and the sub classes are defined next. Specialization is the process of viewing an object as a more refined, specialized object.
Specialization emphasizes the differences between objects.

The process of defining one or more subtypes of the supertype and forming supertype/subtype relationships.


In the above EER diagram an entity type part has been defined with several attributes. The routing number applies only to manufactured parts, supplier-id and unit price applies only to purchased parts. These facts specifies that part should be specialized by defining the subtype manufactured part and purchased part. Routing number is associated with manufactured part.

We can create new relationship between purchased part and supplier. This relationship allows users to more easily associated purchased parts with their supplier.

0 comments:

Post a Comment

Note: only a member of this blog may post a comment.

Find Us On Facebook

Computer Basics

More

C Programming

More

Java Tutorial

More

Data Structures

More

MS Office

More

Database Management

More
Top