Singly Rooted Inheritance Hierarchy

A controversial property required for ObjectOriented languages, according to Alan Kay (see DefinitionsForOo, HeInventedTheTerm, HeDidntInventTheTerm). Part of the controversy is out of simple disagreement, but it is fueled by speculation that he was more or less just being curmudgeonly by insisting on this aspect of his definition.

Definition: All classes must descend from (be subclasses of) other classes, except the root class which must descend form no one. If you follow the inheritance relation at the end all of them must end in the root class, often called Object.

Since there are OO languages that are not singly rooted, this is patently false.

Even languages that attempt to be singly rooted sometimes fail. For instance, Objective-C is single rooted. However, in order to fix a class hierarchy design flaw, the entire class library was redesigned and re-rooted, but for the sake of backward compatibility, there was a period of time during which it had two roots, each of which was intended to be the sole root.

Objective-C is obviously an OO language, so that single one of many possible counterexamples proves your claim false.

Oh, and also there are class hierarchies wherein the root belongs to itself, rather than to nothing, but you said that's disallowed. But it's absurd to say that something that is otherwise an OO language cannot be called OO just because of that single design choice -- one which has almost no effect whatsoever on most programming done in the language.

It's usually more prudent to avoid absolute claims; for instance, in this case, you might say instead "I think that OO languages are better if they have a singly rooted inheritance hierarchy", and then perhaps people could just debate the pros and cons, rather than doing what I did: finding a single counter-example to disprove an absolute claim -- which is often pretty easy, but doesn't necessarily shed a lot of light on the subject under discussion.

Why would the definition at the top of this page exclude Java? All Java classes descend from other classes, except the root class, which is in fact called Object.

OO languages without a SinglyRootedInheritanceHierarchy:

OO languages with:

OO languages with a singly-rooted inheritance hierarchy for "objects", but which have non-object types in the language that do not derive from the universal root.

Likely many more examples out there.
See ObjectOrientation, DefinitionsForOo, InstinctAsIntelligence.

EditText of this page (last edited May 7, 2010) or FindPage with title or text search