Re: Mixing OO and DB

From: Bob Badour <bbadour_at_pei.sympatico.ca>
Date: Thu, 28 Feb 2008 19:40:42 -0400
Message-ID: <47c74681$0$4067$9a566e8b_at_news.aliant.net>


topmind wrote:

> Bob Badour wrote:
> 

>>topmind wrote:
>>
>>>Robert Martin wrote:
>>>
>>>>On 2008-02-26 15:28:43 -0600, topmind <topmind_at_technologist.com> said:
>>>>
>>>>>>I know. And yet it's not a big stretch to different kinds of
>>>>>>databases. If the application uses a simple API to access it's data,
>>>>>>then that API can be seperated from the application by a polymorphic
>>>>>>interface, and dummy databases of a different kind can be substituted
>>>>>>in.
>>>>>
>>>>>A "simple" API is going to replace a sophisticated and powerful query
>>>>>language? I don't think so.
>>>>
>>>>Don't be silly. Of course it can. That's what software is all about!
>>>
>>> doMagic(thinAir);
>>>
>>> ;-)
>>>
>>>>One of the roles of good software design is to hide complexity. We
>>>>take somethign complex, like a robust query languqage, or a tricky IO
>>>>driver, or a fancy third party API, and we hide it behind a simple
>>>>interface that is specific to our application.
>>>>
>>>>In effect we are creating a domain specific language at the high levels
>>>>of our application. That DSL is composed of functions that hide the
>>>>complexity of what lay beneath.
>>>>
>>>>So, for instance, if we must fetch an employee record frequently in
>>>>various parts of our application it is better to use a function like
>>>>this:
>>>>
>>>> Employee e = Employee.find("Bob"):
>>
>>What a fucking moron! He is too stupid to realize that "record at a
>>time" processing is low-level compared to set at a time processing. The
>>mind boggles. It really boggles.
> 
> I don't think that's what he intended, but one cannot tell what
> happens if there is more than one employee from the code alone. But
> apparently some frameworks will load entire objects *and* their
> components (such as paychecks) even if you only need access to parts
> of them, unless you use goofy tricks such as "lazy object loading",
> etc., which can get tricky.
> 
> In procedural/relational programming you generally get what you need
> and *only* what you need from the database.

I don't understand what you mean by procedural/relational. Does the / meant "or" ? Because relational is declarative whereas OO is procedural, which is what makes OO so low-level compared to relational in the first place.

[snip] Received on Fri Feb 29 2008 - 00:40:42 CET

Original text of this message