Subtype hierarchy versus component hierarchy woosΒΆ

Tags: phd

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.

 
vanrees.org logo

Reinout van Rees

My name is Reinout van Rees and I program in Python, I live in the Netherlands, I cycle recumbent bikes and I have a model railway.

Weblog feeds

Most of my website content is in my weblog. You can keep up to date by subscribing to the automatic feeds (for instance with Google reader):