Re: Mixing OO and DB

From: Bob Badour <>
Date: Sun, 02 Mar 2008 18:06:51 -0400
Message-ID: <47cb2504$0$4034$>

frebe wrote:

> On 2 Mar, 19:47, Robert Martin <> wrote:

>>On 2008-02-28 10:36:03 -0600, topmind <> said:
>>>>Of course we can implement other kinds of 'find' methods.
>>>>find_by_date, find_by_salary, etc, etc. Every different query we use
>>>>on a regular basis, we can create a verb for in our DSL. That verb is
>>>>a function call of some kind.
>>>Such only makes sense if you do the same kind of query in *multiple*
>>>spots. One-usage wrappers are a waste of code in my opinion and just
>>>creates tedious red-tape accessor clutter.
>>Not if they are explanatory. Employee.find("Bob") is a lot easier to
>>understand than Select * from Employee_Table where Name = 'Bob';

How exactly does Employee.find(string) inform the reader that the method will return a single employee with a matching name? People understand things better when they are informed.

> Only for people not educated in SQL. Understanding what
> "Employee.find("Bob") ", does, is actually impossible without the
> implementation of find() availible.

I would agree that we can do better than SQL, which I find kind of wordy.

For example, I can imagine useful relational syntax where the following would do:

(Employee where Name = "Bob")

or even

{Employee | Name = "Bob}

[snip] Received on Sun Mar 02 2008 - 23:06:51 CET

Original text of this message