Generalization and specialization are the Enhanced Entity Relationship
diagram (EER-diagram)
1. Generalization :
It works on the principle of bottom up approach. In Generalization lower
level functions are combined to form higher level function which is called
as entities. This process is repeated further to make advanced level
entities.
In the Generalization process properties are drawn from particular entities
and thus we can create generalized entity. We can summarize
Generalization process as it combines subclasses to form superclass.
Example of Generalization –
Consider two entities Student and Patient. These two entities will have
some characteristics of their own. For example Student entity will have
Roll_No, Name and Mob_No while patient will have PId, Name and
Mob_No characteristics. Now in this example Name and Mob_No of both
Student and Patient can be combined as a Person to form one higher
level entity and this process is called as Generalization Process.
2. Specialization :
We can say that Specialization is opposite of Generalization. In
Specialization things are broken down into smaller things to simplify it
further. We can also say that in Specialization a particular entity gets
divided into sub entities and it’s done on the basis of it’s characteristics.
Also in Specialization Inheritance takes place.
Example of Specialization –
Consider an entity Account. This will have some attributes consider them
Acc_No and Balance. Account entity may have some other attributes like
Current_Acc and Savings_Acc. Now Current_Acc may have Acc_No,
Balance and Transactions while Savings_Acc may have Acc_No,
Balance and Interest_Rate henceforth we can say that specialized
entities inherits characteristics of higher level entity.
After applying generalization and specialization, the structure of resultant
figures are same.
Aggregation
An ER diagram is not capable of representing the relationship between
an entity and a relationship which may be required in some scenarios. In
those cases, a relationship with its corresponding entities is aggregated
into a higher-level entity. Aggregation is an abstraction through which we
can represent relationships as higher-level entity sets.
For Example, an Employee working on a project may require some
machinery. So, REQUIRE relationship is needed between the relationship
WORKS_FOR and entity MACHINERY. Using aggregation,
WORKS_FOR relationship with its entities EMPLOYEE and PROJECT is
aggregated into a single entity and relationship REQUIRE is created
between the aggregated entity and MACHINERY.
Aggregation
Representing Aggregation Via Schema
To represent aggregation, create a schema containing the following
things.
the primary key to the aggregated relationship
the primary key to the associated entity set
descriptive attribute, if exists
Difference between Generalization and Specialization :
GENERALIZATION SPECIALIZATION
Generalization works in Bottom-Up
Specialization works in top-down approach.
approach.
In Generalization, size of schema gets In Specialization, size of schema gets
reduced. increased.
Generalization is normally applied to group We can apply Specialization to a single
of entities. entity.
Generalization can be defined as a process
Specialization can be defined as process of
of creating groupings from various entity
creating subgrouping within an entity set
sets
In Generalization process, what actually Specialization is reverse of Generalization.
GENERALIZATION SPECIALIZATION
happens is that it takes the union of two or Specialization is a process of taking a subset
more lower-level entity sets to produce a of a higher level entity set to form a lower-
higher-level entity sets. level entity set.
Generalization process starts with the
Specialization process starts from a single
number of entity sets and it creates high-
entity set and it creates a different entity set
level entity with the help of some common
by using some different features.
features.
In Generalization, the difference and
In Specialization, a higher entity is split to
similarities between lower entities are
form lower entities.
ignored to form a higher entity.
There is no inheritance in Generalization. There is inheritance in Specialization.