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

Redesign vs. Refactor (Was Re: RE: [XP] Candidate for "Replace Conditional With Polymorphism"?)

Expand Messages
  • Laurent Bossavit
    ... But I would say your suggestion is a redesign, not a refactoring. Are you sure that you wouldn t break any tests along the way ? There s an interesting
    Message 1 of 6 , Mar 1, 2001
    • 0 Attachment
      > I liked Laurent's solution, but would propose a sideways way of
      > looking at it that might be even clearer. I present the following
      > rough pseeeeeeudocode:

      But I would say your suggestion is a redesign, not a refactoring.
      Are you sure that you wouldn't break any tests along the way ?

      There's an interesting general question here - is refactoring
      *always* preferable to redesigning, even when (setting myself up as
      devil's advocate) there is an alternative design clearly superior to
      the existing one and you have confidence that you can build the
      new design in and still have all the tests pass at the end ?

      (I know, it's a loaded question. It's intended that way.)


      ========================================
      The best way to predict the future is to
      invent it.
      ========================================
      Laurent Bossavit - Software Architect
      >>> laurent.bossavit@... <<<
      >>> 06 68 15 11 44 <<<
      >> ICQ#39281367 <<
      Agence Bless http://www.agencebless.com/
      ========================================
    • Robert Sartin
      ... Are refactoring and redesign mutually exclusive? That hasn t been my experience. For example, the design of the product I am currently working on is
      Message 2 of 6 , Mar 1, 2001
      • 0 Attachment
        --- Laurent Bossavit <laurent.bossavit@...> wrote:
        > There's an interesting general question here - is refactoring
        > *always* preferable to redesigning, even when (setting myself up as

        Are refactoring and redesign mutually exclusive? That hasn't been my
        experience. For example, the design of the product I am currently
        working on is completely different from what we started with (thank
        goodness, yay test first and refactoring!), but we never stopped and
        did a total redesign. A couple of the changes were very large. As I've
        mentioned here before one major interface addition (Extract Interface
        twice from an existing class and replace most uses of the class to uses
        of one or both interfaces*) caused signature changes in one method each
        for three critical interfaces. It took about two hours between initial
        red bar and final green bar on that one and included changes to
        something like 90% of the classes in our product.

        * - ironically, the class from which the interfaces were extracted no
        longer implements them. That got changed in a recent refactoring to
        simplify that class.

        To refocus, I'll ask specifically: Is there a black/white difference
        between refactoring and redesign?

        Regards,

        Rob


        __________________________________________________
        Do You Yahoo!?
        Get email at your own domain with Yahoo! Mail.
        http://personal.mail.yahoo.com/
      Your message has been successfully submitted and would be delivered to recipients shortly.