Generalization Specialization and Aggregation – 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. There are two abstraction mechanisms used to model information :
- Generalization (Specialization is the reverse process of Generalization)
- Aggregation
Generalization –
Generalization 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.
Another Example : Following Figures shows 3 entities: CAR, TRUCK and MOTORCYCLE
In second Fig. The more general entity type VEHICLE is shown.
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 –
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.
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 –
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).
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.
In simple terms, Aggregation is a process when relation between two entity is treated as a single entity.
Another Examples
:
]]>