Re: Mixing OO and DB

From: Gene Wirchenko <genew_at_ocis.net>
Date: Tue, 04 Mar 2008 10:10:44 -0800
Message-ID: <134rs3h2mcl6ddpik0n3jdmlkg4fqqgt68_at_4ax.com>


Robert Martin <unclebob_at_objectmentor.com> wrote:

>On 2008-03-03 00:08:43 -0600, Gene Wirchenko <genew_at_ocis.net> said:
>
>> Robert Martin <unclebob_at_objectmentor.com> wrote:
>>
>> [snip]
>>
>>> Not if they are explanatory. Employee.find("Bob") is a lot easier to
>>> understand than Select * from Employee_Table where Name = 'Bob'; In
>>> any case, once you have the method, you can polymorphically replace it
>>> with test methods etc.
>>
>> Bah! It is just syntactic sugar and not very sweet at that.
>>
>> Now try finding Bob who works in Accounting:
>> select * from employee_table
>> where name='Bob' and dept='Accounting';
>>
>> Your go.
>
>get_accountant("Bob");
> or
>find_by_name_and_department("Bob", "Accounting");
>
>I'm sure you can think of some others that would read nicer than the SQL.

     Now throw another column into the mix. How many methods are you going to end up with? What will you have gained?

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:

     I have preferences.
     You have biases.
     He/She has prejudices.
Received on Tue Mar 04 2008 - 19:10:44 CET

Original text of this message