Tuesday, November 24, 2009

Bitter Refactoring

Kimberley Bitter
Originally uploaded by kamoda
After reading Martin Fowler's book on Refactoring I've been a big fan of the practice. We all know that adding in tests to insure the refactoring doesn't change the results is essential.
But this last week the real world crept into our world of programming paradigms. We refactored a complicated section of code to make it simpler, more readable, and faster - a big win; except that after the code was fielding, one of our customers reported a problem.
Their use of our product actually depended on a bug in the old version. Refactoring the code fixed the bug and caused our customers grief.
I'm still a big fan of refactoring and continue to do it, but now I'm a little wiser that refactoring carries more risk than I'd thought before.

Friday, November 13, 2009

Simian - a code duplication finder

Today I downloaded simian, a code duplication detector. It's very easy to download and run. Simian detected a few chunks of duplicated code, which need to be refactored into a single method, or pushed up into a parent object. Simian is worth a quick download to test your code. Eval copy is available for free.

C:\opt\simian\bin\simian-2.2.24.exe -reportDuplicateText -threshold=5 *.cs > simian.txt

Wednesday, November 04, 2009

Agile Austin - Domain Driven Design and the Naked Objects Pattern

Last night at Agile Austin Eitan Suez explored the relationship of Domain Driven Design and the Naked Objects Architectural pattern to a packed house of 60 people.
The thing that struck me the most was how using the Naked Objects concept of having the objects themselves create the GUI forces a Ubiquitous Language on the developer since the user will see the object and method names on the screen.
Eitan gave a great example by having the jMatter framework autogenerates a permissions table with objects and their actions on the vertical axis and the types of users on the horizontal axis by reflecting the code and dynamically discovering the objects, their methods, and the types of users.