Mentor SAP
If you do not have a correct understanding of the semantics of “is a (specific)”, you run the risk of identifying the wrong places in which to use inheritance. Sometimes the need for another attribute for a class is incorrectly answered with a specialization.

 

For example, a superclass called Car, contains the subclasses red Car, blue Car, and so on. The statement “A red car is a specific car” is correct only at first glance. However, there are no cars without color. At most, there are some cars that have not been painted. Therefore, every car needs the attribute color, assuming that it is relevant to the application. Therefore, that attribute must be defined in the superclass. There may be contradictions with reality when you try to implement a method for painting cars.