Re: What databases have taught me
Date: Mon, 03 Jul 2006 10:43:00 +0200
Message-ID: <44a8d896$0$624$626a54ce_at_news.free.fr>
Marshall wrote:
> 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?
This is in no way related to SQL/OO. You face this problem as soon as you want to factor out *any* redondant code - the question being 'is the duplication accidental or not ?'.
> 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.
Depends on what you can do in one line of code with the implementation language...
> 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.
Yes we did : we now have a single point of transformation.
> (Of course, not all lines of code
> are of equal complexity, so this is not a precise measure.)
Indeed
-- bruno desthuilliers python -c "print '_at_'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in 'onurb_at_xiludom.gro'.split('@')])"Received on Mon Jul 03 2006 - 10:43:00 CEST