Personal tools
You are here: Home Reinout van Rees' weblog Subtype hierarchy versus component hierarchy woos

Subtype hierarchy versus component hierarchy woos

by Reinout van Rees — last modified Oct 08, 2007 03:59 PM
Filed Under:

I just got an affirmation that a subtype hierarchy is a conceptually difficult thingy. A subtype hierarchy uses the is-a ("a truck is a vehicle") relation to build the hierarchy:

  • vehicle
    • truck
    • car
      • station wagon
      • sedan

But when you want to add tires and a motor to the truck you could put it like this:

  • truck
    • tires
    • motor

Which looks like a component hierarchy.

In the case of a subtype hierarchy those tires and motor would end up in entirely different parts of the hierarchy, as tires aren't vehicles.

When you see a complete subtype hierarchy tree it turns out that many people have a lot of problems to stay focussed on the fact that it's a subtype hierarchy. They keep seeing parts...

Conclusion: I should be very careful in displaying subtype hierarchies in user interfaces... Preferably I should hide them as much as possible.

Document Actions