Notes taken while reading various articles written by Martin Fowler Chief Scientist at ThoughtWorks

Laying Down the Law
Hence, we get to my First Law of Distributed Object Design : Don’t distribute your objects!

http://www.martinfowler.com/eaaCatalog/ Overview of Patterns from his new book MUST BUY THIS BOOK
'The New Methodology' An interesting article about XP and agile methods

Refactoring to Patterns (buy) - This book greatly expands that area discussing in good detail how to evolve most of the popular Gang of Four patterns, showing that they need not be designed in up front, but evolved to as a system grows.

Unit Testing

Refactoring

Refactoring is a controlled technique for improving the design of an existing code base. Its essence is applying a series of small behavior-preserving transformations, each of which "too small to be worth doing". However the cumulative effect of each of these transformations is quite significant. By doing them in small steps you reduce the risk of introducing errors. You also avoid having the system broken while you are carrying out the restructuring - which allows you to gradually refactor a system over an extended period of time.

Martin's Refactoring Catalog - Industrial's Refactoring To Patterns Catalog

By iterating over the design several times, you get a better design. Even throwing away code helps; indeed it is the sign of a good project that it does regularly throw away code. To not do so indicates a lack of learning— and keeping bad ideas around.

Refactoring With Tools The essence of the tools-based approach is the notion of the semantics-preserving transformation. This is a transformation that you can prove will not change the execution of the program. An example of this is a refactoring called extract method. If you have a long section of procedural code, you can make it easier to read by taking a suitable chunk of the procedure and turning it into a separate method. To do this with a tool, you select the code you wish to extract, and the tool analyzes this code, looking for temporary variables and parameters. Depending on what the selected code does with these local variables, you may have to pass in parameters, return a value, or even not be able to do the extraction. The tool does this analysis, prompts for the new method name, asks you to name any parameters, and creates the new method with a call from the old one. The program works exactly the same as it did before but is now a little easier for a human to read.

Refactoring Without Tools Although manual refactoring is not as easy, it is still possible—and useful. It boils down to two principles: take small steps and test frequently. Humans can use the same semantics-preserving transformation tools use, but in method extraction you have to look at the local variables yourself. It takes a little longer, but it isn’t too dif- ficult, because you’re looking at only a small section of code. You then move the code over, put in the call, and recompile.

ThoughtWorks