Re: Object-relational impedence

From: Robert Martin <unclebob_at_objectmentor.com>
Date: Sun, 16 Mar 2008 14:49:53 -0500
Message-ID: <2008031614495310672-unclebob_at_objectmentorcom>


On 2008-03-14 00:17:40 -0500, frebe <frebe73_at_gmail.com> said:

> On 13 Mar, 18:40, Robert Martin <uncle..._at_objectmentor.com> wrote:

>> The real point of that remark was that the user of a tool is at a
>> higher level of abstraction than the tool itself.  SQL is a tool.  ORM

> s
>> are tools that use SQL to get their job done, just like compilers use
>> assembly to get their job done.  In that sense ORMs live at a higher
>> level of abstraction than SQL.

>
> Lets have an example: There are many "compiler" products translating
> from a high-level language like ADA to a low-level language like C,
> instead of translating to machine code directly. What if someone wrote
> a "compiler" translating C source code to ADA source code, would that
> make C more high level than ADA? Hardly? The existance of a product
> translating from language A to language B doesn't say anything about
> the levels of A and B.

That's a good point. The fact that you can write a translator from A->B does not mean A is higher level than B. On the other hand, when A *truly is* higher level than B, there is a lot of leverage to be gained by using A instead of B. That kind of leverage is cost effective and attracts users. More and more people start using A as opposed to B. B falls into less and less use. In the end, while everyone else is off gaining the leverage of A, B is defended by a group of die-hards who demand that all this A nonsense is foolish, and stupid, and who bemoan the fact that nobody truly understands the purity of essense of B.

> If a RDBMS product is implemented using an OOPL, does that make
> relational algebra more high level than OO?

Yes. I think this is obvious on the face of it. RDBs are a much higher level concept than Java, or C++, or OO in general. OO is *code*.

On the other hand, ORMs are higher level than RDBs (not better .. level is not a value judgement) because ORMs make use of RDBs in order to achieve a specific intent.

-- 
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 Sun Mar 16 2008 - 20:49:53 CET

Original text of this message