Re: Mixing OO and DB

From: Robert Martin <unclebob_at_objectmentor.com>
Date: Mon, 18 Feb 2008 10:18:53 -0600
Message-ID: <2008021810185375249-unclebob_at_objectmentorcom>


On 2008-02-15 18:14:35 -0600, topmind <topmind_at_technologist.com> said:

> On Feb 12, 6:49 pm, Robert Martin <uncle..._at_objectmentor.com> wrote:

>> On 2008-02-11 12:44:28 -0600, topmind <topm..._at_technologist.com> said:
>>
>>> A bigger issue is how to manage "variations on a theme". OOP tends to
>>> use polymorphism and object pointers, while a data-centric approach
>>> tends to use set theory and attributes (meta data). I much prefer the
>>> second. I won't claim it objectively better, but to my mind it is a
>>> lot nicer, more flexible, and easier to report/study/sift via query
>>> and table browsers.

>>
>> I won't disagree with any of that.  I will say, however, that I can
>> manage the dependencies between source code modules with OO,
>> and I can't with data.  
> 
> The trick is to shift to a declarative interface/logic so that less
> is
> in app code. Change the problem instead of trying to solve the
> wrong problem.

Of course! And yet there will still be source code that has dependencies that need to be managed.

>> There are other dependencies I can manage with data,
>> that I can't with OO.  Both are useful.  Neither is better than the
>> other.  They are orthogonal and complementary.
>
> I disagree. They tend to fight over the same territory.

The trick is to change the problem instead of trying to solve the wrong problem. They only fight over the same territory if you put them into the same territory. Don't do that. OO is not about data. Don't make it about data.

-- 
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 Mon Feb 18 2008 - 17:18:53 CET

Original text of this message