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.

blog comments powered by Disqus
 
vanrees.org logo

About me

My name is Reinout van Rees and I work a lot with Python (programming language) and Django (website framework). I live in The Netherlands and I'm happily married to Annie van Rees-Kooiman.

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):