Generalization and Specialization in Inheritance Generalization and Specialization in Inheritance
Adil Khan 6 years ago

Generalization and Specialization in Inheritance

Generalization, Specialization, and InheritanceTerms such as superclass, subclass, or inheritance come to mind when thinking about the object-oriented approach. These concepts are very important when dealing with object-oriented programming languages such as Java, Smalltalk, or C++. For modelling classes that illustrate technical concepts they are secondary. The reason for this is that modelling relevant objects or ideas from the real world gives little opportunity for using inheritance (compare the class diagram of our case study). Nevertheless, we would like to further introduce these terms at this point in the figure below.

Generalization

Generalization is the process of extracting shared characteristics from two or more classes, and combining them into a generalized superclass. Shared characteristics can be attributes, associations, or methods.

In Figure below, the classes Piece of Luggage (1) and Piece of Cargo (2) partially share the same attributes. From a domain perspective, the two classes are also very similar. During generalization, the shared characteristics (3) are combined and used to create a new superclass Freight (4). Piece of Luggage (5) and Piece of Cargo (6) become subclasses of the class Freight.

0
1.0K
Effectiveness of TENS and TDCS in cognitive performance and pain reduc...

We will analyze the effectiveness of tDCS (Transcranial Direct Current Stimulation) and &n...

1675638330.png
Adil Khan
1 year ago
Smart wearable for Autism

Individuals with autism are dealing with spectrum of challenges on daily basis, which do n...

1675638330.png
Adil Khan
1 year ago
Smart Superstore Guide

Problem Statement: How to Design Superstore guide system for customers in a way that redu...

1675638330.png
Adil Khan
1 year ago
Adventure Hike VR

?Adventure Hike VR 3D? is a Virtual Reality game which is intended to entertain as well as...

1675638330.png
Adil Khan
1 year ago
FYP MANAGEMENT SYSTEM WITH CLOUD SYNCRONIZATION

ProSys helps students in their Final Year Project. There is no such system already availab...

1675638330.png
Adil Khan
1 year ago