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

[extremeprogramming] Re: When does refactoring become framework b uilding

Expand Messages
  • Robert C. Martin
    ... There are two things to think about here. There is the general need to keep code flexible, and there is the anticipation of new features or changes. The
    Message 1 of 2 , Jan 4, 2000
    • 0 Attachment
      > -----Original Message-----
      > From: Jonas Karlsson [mailto:karlsson@...]

      > I get the impression that despite "You aren't going to need it", in
      > order to refactor effectively, some judgements about what is likely to
      > change in the future must be made.

      There are two things to think about here. There is the general need to
      keep code flexible, and there is the anticipation of new features or
      changes. The two are fundamentally different.

      In an XP project we refactor to:
      1. Make the code as simple as possible.
      2. Eliminate any duplication.
      3. Make the code as clear as possible.
      4. Enhance the flexibility of the code.

      But we do not write code in anticipation of anticipated feature changes.

      Point four above is the one you are worried about. What are the
      principles that are employed to create flexible code? The answer is
      that they are the same principles of dependency management that we have
      always employed in object oriented design.

      This does not mean that you go off generalizing your code and building
      frameworks that aren't explicitly needed. It does however mean that you
      pay close attention to Dependency Inversion, Interface Segregation,
      Substitutability, etc. The principles of OOD (See the publications
      section of http://www.objectmentor.com) still apply in XP.

      Indeed, the principles apply all the more in XP because refactoring is
      so critically important. If the code is not flexible it is difficult to
      refactor. The dependency management principles keep the code as
      flexible as possible so that it can be refactored when new features and
      new generalities are needed.


      Robert C. Martin | OO Mentoring | Training Courses:
      Object Mentor Inc. | rmartin@... | OOD, Patterns, C++,
      Java,
      PO Box 85 | Tel: (800) 338-6716 | Extreme Programming.
      Grayslake IL 60030 | Fax: (847) 548-6853 |
      http://www.objectmentor.com

      "One of the great commandments of science is:
      'Mistrust arguments from authority.'" -- Carl Sagan
    Your message has been successfully submitted and would be delivered to recipients shortly.