Re: The wisdom of the object mentors (Was: Searching OO Associations with RDBMS Persistence Models)

From: Marshall <marshall.spight_at_gmail.com>
Date: 4 Jun 2006 16:37:45 -0700
Message-ID: <1149464265.456640.136510_at_g10g2000cwb.googlegroups.com>


Laurent Bossavit wrote:
> Marshall,
>
> > The point that I'm trying to make is: how hard is it to do ad hoc
> > analysis of a database when the database supports a SQL
> > interface, vs. a custom C-function or Java-class API? There
> > is a significant difference in the efforts needed, and in the
> > degree of flexibility that is supported.
>
> For whom ? An OO expert, an SQL expert, a user ? Are you saying there's
> an *absolute* difference, not just a relative one ? If the latter, where
> does that difference come from ?

I'm not entirely certain what you mean by the distinction between "absolute" and "relative." If what you're asking is, is the difference due to the expertise of the user, or due to the tools, then my answer is that it is due to the tools.

However, that doesn't mean the expertise of the user has no impact on a specific outcome:

If we ask which one can dig a big hole faster, a guy with a shovel or a guy with a backhoe, we must give the advantage to the backhoe. This is true even though we could set up a competition where the guy with the backhoe was unable to start the engine, and hence lost. Doesn't matter: the backhoe is still the better tool for digging.

As to where the difference comes from, it comes from the specificity of the tool to the task, the superiority of the metamodel (for the task), and the higher level of abstraction.

The SELECT statement is a domain-specific language designed specifically for doing queries. A C function is a general purpose abstraction mechanism for computation. We should not be the least surprised that the specialized tool is better suited for its specialized task than a general purpose tool is.

Also note that I am talking here specifically about ad-hoc queries. So the specific queries that are going to come up are *not known* at the time you design your C API. You C API has to be fully general, and not designed for the particular queries (although it can be designed for the schema.) To be as capable as SQL, your C API has to fully support any join or combination of joins, with any projection, any selection predicates, any grouping, etc. that I can come up with. If the API can't do it directly, you need to write procedural code to fill in the gaps.

Marshall Received on Mon Jun 05 2006 - 01:37:45 CEST

Original text of this message