Re: Mixing OO and DB

From: topmind <>
Date: Tue, 4 Mar 2008 14:43:03 -0800 (PST)
Message-ID: <>

On Mar 4, 2:19 pm, Robert Martin <> wrote:
> On 2008-03-03 11:04:14 -0600, topmind <> said:
> > The Clutter Tax of wrapping is there for almost every maintenance
> > transaction
> Your penchant for sloganeering evokes tedium.

I'll take that as a compliment.

> Wrapping query results into objects can sometimes be more work than
> it's worth. Other times it saves a great deal of work because of the
> increase of abstraction level.

How are you measuring "work" here? Reading time, or code-changing time? While I will agree it may provide a slight improvement in reading speed[1] of a given routine, it is certainly NOT a code editing simplifier because you have to jump down to the wrapper method to make changes. You not only have to change the SQL, but also the interface. Thus, it has 3 change points per *one* change point for inline  SQL. We thus have 3 factors to consider:

  1. Read-time in target routine
  2. Hunt-time when looking for sub-methods (more methods equals more time). This is both when going to find a particular wrapper and any time we need to look for routines for other purposes, where the namespace is cluttered with wrappers.
  3. Change points

Wrapping gives a slight gain in #1, a medium loss in #2, and a big loss in #3. Thus, a net loss. Unless you can argue there is a *huge* reading advantage, time-and-motion studies will not back you.

[1] Until one has to dig around in the extra method/functions to find something.

> --
> Robert C. Martin (Uncle Bob) | email:
> Object Mentor Inc. | blog:

-T- Received on Tue Mar 04 2008 - 23:43:03 CET

Original text of this message