Re: Object-relational impedence

From: JOG <>
Date: Wed, 12 Mar 2008 02:21:53 -0700 (PDT)
Message-ID: <>

On Mar 11, 1:05 am, Robert Martin <> wrote:
> On 2008-03-08 21:39:37 -0600, JOG <> said:
> > On Mar 9, 2:23 am, Robert Martin <> wrote:
> >> On 2008-03-06 06:37:19 -0600, JOG <> said:
> >>> On Mar 6, 6:26 am, Robert Martin <> wrote:
> >>>> That's not inferrence.
> >>> Well that all jolly-well looks like inference to me.
> >> I agree that you can infer what elements a subclass has by knowing the
> >> elements of the base class.
> > Well then you have conceded defeat, given our conversation has gone as
> > follows:
> > jog: "So why not treat all 'inheritance' in this way [as inference]?"
> > Robert: "Because all inheritance is not about inference."
> > jog: show me an example when it is not.
> > Robert: I'll ignore that, and just describe the OO mechanism again.
> > jog: Look, here is how everything you have listed could have been
> > described through inference
> > Robert: Ok, I agree that all inheritance can be described via
> > inference.
> Here's the starting point of the conversation. You wrote:
> >> Name(x, Aristotle) -> Species(x, Man)
> >> Species(x, Man) -> Mortality(x, Mortal)
> >> |= Name(x, Aristotle) -> Mortalilty(x, Mortal)
> >> No types or reification in sight. Instead I had two groups of
> >> statements:
> >> People = {Name, Species, Bday}
> >> Entities = {Species, Mortality}
> >> A join of the two statements gave me the inference I required: {Name,
> >> Mortality}. All of a sudden it seemed simple. So some questions:
> >> 1) So why not treat all 'inheritance' in this way?
> >> 2) Could one extend to include 'behaviour' as well?
> >> 3) And is this a crazy thing to suggest in a cross post to an OO
> >> group?
> I responded to your first question that when you need to make
> inferences, an inference engine is a good tool. Inheritance is not an
> inference engine.

A red herring as far as I'm concerned this Robert - after all RM is not an "inference engine" either. What I am questioning whether we need the concept of inheritance /whatsoever/. It does not exist in logic, it has no underlying theoretical justification, and is purely an ad hoc mechanism thrown together at xerox parc. Is it not true that inheritance has lost favour over the years - composition is generally preferred, unless one is defining interfaces (and whether that should still be called "inheritance" is open to debate).

> And you challenged me:
> >> Interesting story. Yes, when you have a problem of inference, it's
> >> good to use an inference engine.
> >>> So some questions:
> >>> 1) So why not treat all 'inheritance' in this way?
> >> Because all inheritance is not about inference.
> > Hmmm. Then might you give an example of a situation where inheritance
> > cannot be described in terms of inference?
> To which I described what inheritance is:
> > Inheritance is simply the redeclaration of functions and variables in a
> > subscope. That's not inferrence.

Yes, but I was asking for an example of when the /result/ of inheritance could not be described by inference. You answered a different question (albeit with the best of intentions I am sure). I discuss this further on.

> To which you said "subscope" was a nonsense word, and we had to define
> our terms. (sigh).

I believed the word was nonsense in terms of relevancy to what I had asked, not in terms of it having no definition (so 'sigh' right back at you sunshine). Lets put it down as standard usenet fare and move on.

> Then you said:
> > Well that all jolly-well looks like inference to me.
> And I said ... well you can read it above.
> > I guess we are done, your objection having been overcome.
> JOG, you're original question was: Why not treat all inheritance as the
> kind of inferrence you get from a database join.

Yes, I think you have missed my gist though. The question is why use a "Redeclaration mechanism" (if you want to call it that) to handle data transformation at all. An answer of "that's just how OO does it" is not really what I was interested in exploring.

> Answer: Because inheritance is not inference. Inheritance is the
> redeclaration of variables and functions in a subscope.
> > I think because of your OO focus you haven't
> > recognized that (in this case) there is a danger of putting the cart
> > before the horse. Logic first, mechanism second, not t'other way
> > around.
> On the contrary, your initial question was:
> Why can't the mechanism be treated like the logic.

That was not my question at all. While you are referring to inheritance as a mechanism, I am referring to what is /achieved/ via the mechanism. Saying "redeclaration in a subscope" is no answer to what I intended - it is like answering the question "why do we eat" with "to put food into our stomachs".

Perhaps we are speaking across each other because you are focussing on the T and not the I of IT (this sadly proliferates the field, so I'm not intending to be disparaging to you personally, but rather to help conversation). Information is the subject matter of our area, and that is where we should start, not trying to squash it into whatever hole are particular favourite tehcnology is. If noone the importance of anlaysing the nature of information, we'd still all be using flipping CODASYL right? So, I challenge you to step back from an individual mechanism and look at data and behaviour theoretically.

I contend that if we can do that, we will find there is in fact some middle ground in between OO and the prinicples behind relational theory, where the conceputual layer (object boundaries and behvaiours) can be decoupled from data (the logical layer) all in the same language.

> My answer was: because it's a mechanism.
> So it seems to me that you are the one with the problem discerning the
> difference between logic and mechanisms.
> Now, I understand your original point. You were trying to use
> inheritance as a way to make an inference, and then later found that a
> database join was a better approach. Good! Inference engines are
> usually better at making inferences than redeclaration mechanisms. But
> the conclusion you apparently drew from this is that there was
> something wrong with the mechanism (inheritance) and that it should be
> more like a database join. That's rather like pounding a nail with a
> screwdriver and then wishing it was more like a hammer.
> --
> Robert C. Martin (Uncle Bob) | email:
> Object Mentor Inc. | blog:
> The Agile Transition Experts | web:
> 800-338-6716 |
Received on Wed Mar 12 2008 - 10:21:53 CET

Original text of this message