Wednesday, 31 August 2016

Generalization and Specialization


Generalization and Specialization

Generalization, Specialization and Aggregation in Database management system are abstraction mechanisms used to model information. The abstraction is the mechanism used to hide the redundant details of a set of objects. For example, vehicle is abstraction that includes the type’s jeep, car and bus.
So, the two abstraction mechanisms used to model information:
Generalization (Specialization is the reverse process of Generalization)
The process of extracting common characteristics from two or more classes and combining them into a generalized superclass, is called Generalization.
Specialization is the reverse process of Generalization means creating new sub-classes from an existing class.
Let’s take an example of Bank Account; A Bank Account is of two types –Saving Account and Current Account. Saving Account and Current Account inherits the common/ generalized properties like Account Number, Account Balance etc. from a Bank Account and also have their own specialized properties like interest rate etc.

 A more general class is referred to as a ‘super class’ while a specialized class is called as a ‘sub class’. The relationship between these two classes is called generalization.
 It is represented as follows :

 In the above example we have a general class ‘Vehicles’ with its specialized sub classes, ‘ TwoWheeler’,’ThreeWheeler’ and ‘FourWheeler’. We show generalization between these classes using a hollow arrow head arrows between the sub class and the   super class such that the arrow head points towards the general class.
 Ellipses (…) indicate incomplete generalization and possibility of addition/representation of
 More sub classes. Consider,

 If a text label is placed on the hollow arrowhead then it indicates that all the following subclasses share that property.