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

[extremeprogramming] Re: C++ file oriented refactorings

Expand Messages
  • Robert C. Martin
    ... I always create source files that are 1:1 with classes. This makes it much easier to manage the interdependencies in the code. ... You will find that you
    Message 1 of 8 , Jan 30, 2000
    • 0 Attachment
      > -----Original Message-----
      > From: Andy Glew [mailto:glew@...]
      >
      > Finally, these file oriented refactorings are like the class
      > and object oriented
      > refactorings, in that they often lead to more, smaller files,
      > indeed files that often
      > correspond 1:1 with classes.

      I always create source files that are 1:1 with classes. This makes it
      much easier to manage the interdependencies in the code.

      > Unfortunately, more, smaller, files are a pain for those of
      > us who have to deal
      > with really slow C++ compile times.

      You will find that you gain much more speed by managing dependencies,
      than you do by consolodating source files. In a system with unmanaged
      dependencies, compile time approaches some factor of N^2 where N is the
      number of modules. Consolodating modules reduces N, which certainly has
      an effect. But managing dependencies reduces compile time to NLogN
      which has a much greater effect.

      In C++, in order to refactor effectively, compile times must be short
      and the impact of change must be low. This requires that dependency
      management be employed all the time. Over the years I have developed
      many principles of dependency management. See the publications area of
      www.objectmentor.com for details.


      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.