Additional features of ER Model (Generalization Specialization and Aggregation)

Generalization Specialization and Aggregation in DBMS are abstraction mechanisms used to model 
information. The abstraction is the mechanism used to hide the superfluous details of a set of objects. For example, vehicle is a abstraction, that includes the types car, jeep and bus.
So, the two abstraction mechanisms used to model information :
  • Generalization (Specialization is the reverse process of Generalization)
  • Aggregation

Generalization in DBMS –

generalizationGeneralization is a abstracting process of viewing sets of objects as a single general class by concentrating on the general characteristics of the constituent sets while suppressing or ignoring their differences.
In simple terms, Generalization is a process of extracting common characteristics from two or more classes and combining them into a generalized superclass. So, it is a bottom up approach as two or more lower lever entities are combined to form a higher level entity.
The common characteristics means here attributes or methods.

Notation of Generalization –

Generalization is represented by a triangle with a line.
generalisation notation-Generalization Specialization and Aggregation in DBMS
Generalization is an IS_A relationship

Example of Generalization :

For example, a Part_Time Employee and Full_Time Employee entity sets can be generalized as EMPLOYEE entity sets;
The Full_Time_Employee is a generalization of the entity set Faculty and Staff;
The Part_Time_Employee is a generalization of the entity set Teaching and Casual.
Employee (Generalization Specialization and Aggregation in DBMS)
Another Example : Following Figures shows  3 entities: CAR, TRUCK and MOTORCYCLE
Generalization-(Generalization Specialization and Aggregation in DBMS)
In second Fig. The more general entity type VEHICLE is shown.
Generalization-(Generalization Specialization and Aggregation in DBMS)

MOTORCYCLE entity is not shown as it does not satisfy conditions for a subtype because it has all the attributes common to all vehicles. So, there are no attributes specific to motorcycles. Further, MOTORCYCLE does not have a relationship to another entity type

Specialization in DBMS –

Specialization
Specialization may be seen as the reverse process of Generalization. Specialization is the 
abstracting process of introducing new characteristics to an existing class of objects to create one or more new classes of objects.
In simple terms, a group of entities  in specialization can be categorized into sub-groups based on their characteristics. So it is a top-down approach in which one higher level entity can be broken down into two lower level entity. It defines one or more subtypes of the supertypes and forming supertype/subtype relationships.

Example of Specialization :

Employee-(Generalization Specialization and Aggregation in DBMS)
In the above example, Faculty and Staff inherits the attribute salary of the entity set Full_Time_Employee and latter, in turn inherits the attributes of Employee. So, Faculty and Staff is a specialization of Full_Time_Employee and Full_Time_Employee is a specialization of Employee.
Similarly, Teaching and Casual inherits the attribute Wage of the entity set Part_Time_Employee and latter, in turn inherits the attributes of Employee. So, Teaching and Casual is a specialization of Part_Time_Employee and Part_Time_Employee is a specialization of Employee.

Aggregation in DBMS –

aggregration
Aggregation is the process of compiling information on an object, thereby abstracting a higher level 
object. So,an entity Person is derived by aggregating the characteristics name, house_no., city and social security number(SSN).
aggregation in DBMS
Another form of aggregation says that it is abstracting a relationship between objects and viewing the relationship as an object. So, in Figure 2, the Enrollment relationship between entities student and Course entity can be viewed as entity REGISTRATION.
registration
In simple terms, Aggregation is a process when relation between two entity is treated as a single entity.
Another Example of Aggregation :
Aggregation Example2-generalization specialization and aggregation Aggregation Example2-generalization specialization and aggregation

No comments:

Post a Comment