Re: Mixing OO and DB
From: Bob Badour <bbadour_at_pei.sympatico.ca>
Date: Thu, 28 Feb 2008 14:14:49 -0400
Message-ID: <47c6fa19$0$4062$9a566e8b_at_news.aliant.net>
>>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!
>>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"):
Date: Thu, 28 Feb 2008 14:14:49 -0400
Message-ID: <47c6fa19$0$4062$9a566e8b_at_news.aliant.net>
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.
[snip] Received on Thu Feb 28 2008 - 19:14:49 CET