Feed on
The DoubleDawgDare Series:

GeePawHill takes on a horrific smush of legacy code

— real, not rigged —

and refactors it towards art.


8 Responses to “DoubleDawgDare Series”

  1. Jeff Grigg says:

    Re: “DoubleDawgDare 5: Pick, Pick, Pick”

    I notice that…
    Validation -> processValidationPlural
    Validations -> processValidationAnnotationSingular
    (annotation name -> goes to -> method name)

    So “Validation” is Plural, while “ValidationSSS” is Singular?

    To be more consistent with the other methods, I would probably call them “processValidation” and “processValidations”.
    _ _ _

    I noticed that the code in the “processValidationAnnotationSingular” method contains copies of the code in nearly all of the other “process*” methods. (Everything except DoubleRangeFieldValidator.) I would suggest deleting the unnecessary null checks from that code, and then for each “process*Validator” method, extract all the lines except the first into a method of the same name, and then inline the original method (back into the processSingleAnnotation method). I think you’ll like the effect this will have on the processValidationAnnotationSingular/processValidations method.
    _ _ _

    Looking through the class, I too have a very strong feeling that I would create a wrapper class for each annotation class, give them a common abstract base class, and then use reflection to find and create them and dispatch to them.

  2. Jeff Grigg says:

    Sincere thanks for the “Eclipse Java Code Formatter Settings” file.

    A suggestion: When I change “Line Wrapping -> General settings -> Maximum line width” to something larger than 80, I also change “Comments -> Maximum line with for comments” to match. (But maybe you want to keep comments shorter so they’ll be more readable?)

  3. Jeff Grigg says:

    Want to post a link to step #7 here?


    It’s a great next step!

  4. Jeff Grigg says:

    If this exercise gets you, the readers, excited, be sure to check out

    It’s a place where people ask for refactoring (and bug fixing) on a wide variety of small focused problems.

    I’ve been making a few small contributions there.
    – jeff

  5. […] as testing challenges, Weekend Testing or Testing Dojos, as well as Coding Dojos, Coding Katas, and Refactoring challenges. Skimming code to seek improvements has become as vital to me as testing a new application for […]

  6. […] really been enjoying GeePawHill’s DoubleDawgDare screencasts. They’re refactoring legacy code, not TDD, but he definitely has the TDD ethos, and – […]

Leave a Reply

AWSOM Powered