Re: Mixing OO and DB

From: topmind <topmind_at_technologist.com>
Date: Tue, 4 Mar 2008 14:43:03 -0800 (PST)
Message-ID: <22331066-0acd-464f-849a-0b84f0991d12_at_s8g2000prg.googlegroups.com>


On Mar 4, 2:19 pm, Robert Martin <uncle..._at_objectmentor.com> wrote:
> On 2008-03-03 11:04:14 -0600, topmind <topm..._at_technologist.com> 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: uncle..._at_objectmentor.com
> Object Mentor Inc. | blog: www.butunclebob.com

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

Original text of this message