Re: Object-relational impedence

From: Robert Martin <unclebob_at_objectmentor.com>
Date: Thu, 13 Mar 2008 12:02:23 -0500
Message-ID: <2008031312022329267-unclebob_at_objectmentorcom>


On 2008-03-12 04:21:53 -0500, JOG <jog_at_cs.nott.ac.uk> said:

> What I am questioning whether we
> need the concept of inheritance /whatsoever/.

Is inheritance necessary? Certainly not. Is it useful? Certainly.

> It does not exist in
> logic, it has no underlying theoretical justification, and is purely
> an ad hoc mechanism thrown together at xerox parc.

I think it was "thrown together" in Norway by Dahl and Nygaard. I could be wrong. But so what? It's a useful tool.

> Is it not true that
> inheritance has lost favour over the years -

Overuse, yes. Not use.

> composition is generally preferred,

Generally, yes.

> unless one is defining interfaces (and whether that should
> still be called "inheritance" is open to debate).

Inheritance is the redeclaration of functions and variables within a subscope. That fits rather well with the abstract methods of an interface.

-- 
Robert C. Martin (Uncle Bob)  | email: unclebob_at_objectmentor.com
Object Mentor Inc.            | blog:  www.butunclebob.com
The Agile Transition Experts  | web:   www.objectmentor.com
800-338-6716                  |
Received on Thu Mar 13 2008 - 18:02:23 CET

Original text of this message