Oracle FAQ Your Portal to the Oracle Knowledge Grid

Home -> Community -> Usenet -> comp.databases.theory -> Re: The wisdom of the object mentors (Was: Searching OO Associations with RDBMS Persistence Models)

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

From: <>
Date: 2 Jun 2006 15:09:49 -0700
Message-ID: <>

> >Yes, in some cases it would be an excellent idea, but why don't we
> >normally separate math libraries?
> Um, we still do, or certainly did until recently, if using C on most Unix
> platforms - you had to explicitly link in a math library, 'libm', if you
> wanted to use anything other than simple addition, multiplication or
> similar.

Ever tried to replace java.lang.Math? It wouldn't have been very difficult for Gosling&Co to make a decoupled Math class. But still they didn't. It was simply not worth the effort.

> >Because the cost is higher than the benefits in most cases.
> As things like disk and memory space get less expensive and processors get
> faster, some such costs decrease - in the case of a math library, the
> extra space is hardly even noticable these days, but there may still be
> reasons for why you might want to use a _specific_ math library
> implementation (if you need to have completely repeatable results down to
> the least significant bit, which is somehthing where some CPUs can
> actually differ - or if you can sacrifice some specific accuracy in the
> quest for extra speed, or if you replace code that uses the floating-point
> processor with code that uses the vector unit, or similar).

Of course I am not talking about CPU time here. I am talking about development time. Compare

rs = sql("select companyid, name from company where name like 'E%'");


rs = findCompaniesByNameStartingWith("E");

List findCompaniesByNameStartingWith(name) {

    rs = sql("select * from employee where name like '" + name + "%'");     result = new ArrayList();
    while ( {

        c = new Comapny(rs.getString("companyid"),

    return result;

Which one do you think take less time to write?

> In my experience, it's usually well worth separating out SQL into a, well,
> separate part of the application, for ease of maintenance if nothing else
> (because it keeps all the SQL code, which may be a comparatively small
> proportion of the total code, close together rather than spread out,
> which makes it easier to find, if/when it needs maintenance).

My experience is exactly the opposite. In an average enterprise application, the SQL code is not a comparatively small proportion of the total code.

If you have problem finding SQL code, i suggest that you use the search function in your IDE. By the way, what kind of maintenance are you thinking about? If I said that I want to separate all use of the mathematical operators (+, -, *, /) into a separate part of the application, because it makes it easier to find when it needs maintenance, probably nobody would accept it.

Fredrik Bertilsson Received on Fri Jun 02 2006 - 17:09:49 CDT

Original text of this message