April 2017
Beginner to intermediate
394 pages
9h 16m
English
The final problem with our inheritance approach involves the situation where we take code reuse to the extreme. In our hierarchy, we have SuperRaider, which is very fast, weak, and shoots little bullets. We also have SuperBomber, which is slow, strong, and shoots big bombs. Someday, a clever designer will want to create SuperBomberRaider that is very fast, strong, and shoots both little bullets and big bombs. Here is our partial tree:

This, of course, is the Diamond of Death (or Dreaded Diamond of Death), so named because the inheritance tree forms a diamond. The problem ...
Read now
Unlock full access