We ‘d speak about a very common problem happened while using multi-level inheritance
it’s called Diamond problem
we will discuss it using a simple example

Suppose we are in a system that requires to model two entities

  1. Student that has an age and a grade
  2. Worker that has an age and a salary

it’s better to make our design using inheritance ending with three classes

  1. Person class has age attribute
  2. Student class that inherits Person class and has grade attribute
  3. Worker class that inherits Person class and has salary attribute

(more…)