Re: What databases have taught me

From: David Cressey <dcressey_at_verizon.net>
Date: Fri, 07 Jul 2006 09:28:25 GMT
Message-ID: <ZOprg.3016$Sr1.1820_at_trndny08>


"Robert Martin" <unclebob_at_objectmentor.com> wrote in message news:2006070418040895335-unclebob_at_objectmentorcom...
> On 2006-07-02 19:42:08 -0500, "Marshall" <marshall.spight_at_gmail.com> said:
>
> > Robert Martin wrote:
> >>
> >> I think you'd need this code anyway if the above query was issued from
> >> more than one place. I doubt you'd want to duplicate the string.
> >
> > It depends. If we imagine the same query existing in two places
> > in the code, and imagine what could make us want to change it
> > in the future, do we imagine that we'd necessarily change *both*
> > together or might we just want to change one?
> >
> > There is also the question of how little code can there be such
> > that we still call it a coherent abstraction? My general claim is
> > that one line of code is typically *not*a coherent abstraction.
> > Because once we abstract it as a method, what do we
> > need to do to invoke that method? One line of code.
> > So we didn't gain anything. (Of course, not all lines of code
> > are of equal complexity, so this is not a precise measure.)
>
> My general rule of thumb is that if two identical lines of code change
> identically over time, then they should be a single line of code in a
> function that's called twice.
>

That's a matter of binding isn't it? Received on Fri Jul 07 2006 - 11:28:25 CEST

Original text of this message