Geeks With Blogs
My Blog geek yapping June 2009 Entries
Program to an interface, not to an implementation
Program to an interface, not to an implementation
Not sure if this has a source, but it’s a great concept.

Posted On Saturday, June 20, 2009 1:41 PM

Refactoring - Compose Method
This refactoring, again from Refactoring to Patterns, reduces ambiguity in methods that have too much detail or conditional logic to quickly comprehend. By breaking a method down into smaller methods, the ambiguity can be removed. The mechanics of this refactoring are rather subjective, but obviously lead to the use of Extract Method. Study the code and make sure you understand it, the longer this takes, the more you need to apply this refactoring! Clean up the code, look for unused or duplicated ......

Posted On Wednesday, June 17, 2009 7:22 PM

Chain Constructors
Chain Constructors is another refactoring from the book Refactoring to Patterns, it helps remove duplication in constructor overloads. This should be a very familiar refactoring for most developers. Catch all constructors are produced, and hopefully minimized, that other constructors rely on either directly or indirectly. Mechanics Study the constructors in the class and find the two with the most shared code. Say I have two constructors to create lines as follows: public class Line { ... private ......

Posted On Wednesday, June 17, 2009 5:52 PM

Refactoring, Creation Methods
Lately, I’ve been engulfed in several design books, one of which is Refactoring to Patterns by Joshua Kerievsky. The book is an extension of Martin Fowler’s book, Refactoring. It emphasizes learning to use patterns by working with existing code, identifying code that “smells” and then finding a pattern to refactor the code “to, towards or away from.” Smelly code typically involves duplication, complexity and/or ambiguity. Joshua believes, rather than heavy pattern use up front, to let code evolve ......

Posted On Tuesday, June 16, 2009 8:46 PM

Copyright © Wes McClure | Powered by: