Loading ...
Sorry, an error occurred while loading the content.

Re: [XP] removing duplication may lead to huge class hierarchies?

Expand Messages
  • William Wake
    Hi - A few things struck me while I was reading this... I don t know if any will lead in a helpful direction for you. ... I don t know if Person is the right
    Message 1 of 36 , Jun 2, 2005
    • 0 Attachment
      Hi -
      A few things struck me while I was reading this... I don't know if any
      will lead in a helpful direction for you.

      > So when applying TDD to this problem I would first come up with two
      > distinct classes: PersonA and PersonB

      I don't know if Person is the right thing for this data. The way you
      describe it (multiple sources, must retain differentiation), I get the
      picture of one Person with a collection of PersonalData (each with a
      potentially different source).

      > Then I should refactor and
      > remove the duplication of firstname and lastname

      Perhaps yes, but the thing that seems to be missing to this point is
      any kind of behavior. Are these just bags of data? If so, then maybe a
      map structure of some sort would be an improvement.

      Also, names are complicated. Cher, Madonna, and Appa (the Sherpa who
      just broke the record for climbing Mount Everest) only have one name.

      > now can't serialize the
      > object to XML for export using just the reflection API,

      Right - you'd have to make some adjustments there.


      Is there a master list of the possible fields, or is it just on a
      case-by-case basis? What I've typically seen is some structure becomes
      the master format, then the problem is mapping in and out on a
      case-by-case basis. But it all depends what you're doing with the
      data.

      Regards,
      --
      Bill Wake William.Wake@... www.xp123.com
    • Kent Beck
      Steve, I meant to say what I said. I really do prefer problems where I get to choose whether I solve them over problems I simply have to cope with. With
      Message 36 of 36 , Jun 9, 2005
      • 0 Attachment
        Steve,

        I meant to say what I said. I really do prefer problems where I get to
        choose whether I solve them over problems I simply have to cope with. With
        reasonable amounts of communication, the situation you describe is unlikely
        to occur. If you and your colleagues are unable to communicate about
        duplication, you may choose to eliminate it before you have to deal with
        anyone else. I was telling you what I would do. I trust my teammates to make
        good choices for our team.

        Kent Beck
        Three Rivers Institute

        > -----Original Message-----
        > From: extremeprogramming@yahoogroups.com
        > [mailto:extremeprogramming@yahoogroups.com] On Behalf Of Steven Gordon
        > Sent: Tuesday, June 07, 2005 8:32 AM
        > To: extremeprogramming@yahoogroups.com
        > Subject: RE: [XP] removing duplication may lead to huge class
        > hierarchies?
        >
        > Kent,
        >
        > This attitude is fine if you are the only developer.
        >
        > In a team situation, however, there may be at least one
        > developer who does not have the restraint to avoid the
        > temptation to prematurely turn some innocuous duplication
        > into a hierarchy (or some other pattern they perceive will be
        > useful in the future), leaving you to cope with their
        > decision (or to undo it and face their wrath on the occasions
        > where their vision of the future happened to come true).
        >
        > Perhaps, you meant to say something like:
        >
        >
        > It is *our* choice whether *we* eventually
        > remove the duplication or not. We should prefer
        > problems where we get to choose whether we
        > solve them or not over problems we simply have to cope with.
        >
        >
        > Steve
        >
        >
        >
        > -----Original Message-----
        > From: extremeprogramming@yahoogroups.com on behalf of Kent Beck
        > Sent: Tue 6/7/2005 7:52 AM
        > To: extremeprogramming@yahoogroups.com
        > Cc:
        > Subject: RE: [XP] removing duplication may lead to huge
        > class hierarchies?
        >
        >
        >
        >
        >
        > > -----Original Message-----
        > > From: extremeprogramming@yahoogroups.com
        > > [mailto:extremeprogramming@yahoogroups.com] On Behalf Of
        > > Wojciech Biela
        > > Sent: Friday, June 03, 2005 2:02 AM
        > > To: extremeprogramming@yahoogroups.com
        > > Subject: Re: [XP] removing duplication may lead to huge class
        > > hierarchies?
        > >
        > > I like the approach and agree that it should work
        > well. Having said
        > > that I'd like to add more cons that concern me
        > > * You have to remember to finally remove the
        > duplication, not leave
        > > it be with a
        > maybe-someday-I'll-come-up-with-something tag for the
        > > rest of the project
        > > * There a good chance the above will happen, and
        > you'll have a lot
        > > of such cases
        > >
        > > I'm not trying to sound pessimistic I just wonder
        > what's the chance
        > > it'll happen.
        >
        > It is my choice whether I eventually remove the
        > duplication or not. I like
        > problems where I get to choose whether I solve them or
        > not better than
        > problems I simply have to cope with.
        >
        > Kent Beck
        > Three Rivers Institute
        >
        >
        >
        > To Post a message, send it to: extremeprogramming@...
        >
        > To Unsubscribe, send a blank message to:
        > extremeprogramming-unsubscribe@...
        >
        > ad-free courtesy of objectmentor.com
        > Yahoo! Groups Links
        >
        >
        >
        >
        >
        >
        >
        >
        >
        >
        > [Non-text portions of this message have been removed]
        >
        >
        >
        > To Post a message, send it to: extremeprogramming@...
        >
        > To Unsubscribe, send a blank message to:
        > extremeprogramming-unsubscribe@...
        >
        > ad-free courtesy of objectmentor.com
        > Yahoo! Groups Links
        >
        >
        >
        >
        >
        >
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.