Re: Mixing OO and DB

From: Robert Martin <unclebob_at_objectmentor.com>
Date: Sun, 2 Mar 2008 14:37:07 -0600
Message-ID: <2008030214370777923-unclebob_at_objectmentorcom>


On 2008-02-29 23:04:11 -0600, Marshall <marshall.spight_at_gmail.com> said:

>> The relational database
>> implementation can be replaced with some completely different
>> mechanism that implements the same interface and the application
>> remains unaffected.  Decoupling.

>
> Ten years ago I thought that sort of thing seemed a promising
> approach. Today, after having built many systems using this and
> a variety of other approaches, it is obvious to me why what you
> suggest requires throwing away most of the value of the RDBMS.

Not at all. Indeed the value of the RDBMS is *preserved* and enhanced by such a technique. Remember the RDBMS is still there. SQL is still used. All the benefits are still within reach. At the same time the RDBMS is decoupled from the main body of the application. Decoupling doesn't mean "unused". Decoupling refers to the *direction* of the source code dependencies. We move the RDBMS code to modules that the main application source code does not depend upon.

This is the tool that OO gives us. It allows us to have binary and runtime dependencies point in the opposite direction of source code dependencies.

-- 
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 02 2008 - 21:37:07 CET

Original text of this message