Depth of Inheritance

Indicates the number of class definitions that extend to the root of the class hierarchy. The deeper the hierarchy the more difficult it might be to understand where particular methods and fields are defined or/and redefined.

Depth of Inheritance is also called as Depth of Inheritance Tree.

  • DIT (C0) = 0
  • DIT (C0’) = 0
  • DIT (C1) = 1
  • DIT (C2) = 2
  • DIT (C3) = 3
  • DIT (C4) = 4

Depth of inheritance in the example shown here is 4