Category Archives: Refactoring

Refactoring Challenge Part 3 – Pattern Implementation

In the previous part to the refactoring challenge, I needed to structure the original implementation to a point where I could start applying other refactorings.  Whenever I start to see a bunch of “if” statements or a big switch statement, … Continue reading 


Refactoring challenge Part 2 – Preparation

Other posts in this series: Refactoring challenge – cry for help Part 1 – Examination In the last part of this series, I took a closer look at the code smells found by commenters, which included: No tests Feature envy … Continue reading 

| 1 Comment

Refactoring challenge Part 1 – Examination

Most of the time I post code on my blog, it’s something I’m proud of.  Other times, it’s code I didn’t write, which I promptly lambaste.  In my last post, I threw up code I did write, but couldn’t see … Continue reading 


Refactoring challenge

I don’t like messy, obfuscated code.  But occasionally often, I write it anyway as I can’t quite see the right way to go.  Today is one of those days where I can’t seem to get past some ugly code, none … Continue reading 


How not to do Dependency Injection, in NerdDinner

Checking out the NerdDinner code the other day, I found a common Dependency Injection anti-pattern.  One of the core concepts of DI is that components are not responsible for locating their own dependencies.  The code went part of the way … Continue reading 

Also posted in ASPNETMVC, StructureMap | 43 Comments

Fighting technical debt with the wall of pain

Technical debt, even on the agile-ist of agilista teams, still accumulates.  Debt is inevitable, as initial design is always based on assumptions, not all of which pan out.  I never view that as a failure, as all we can do … Continue reading 

Also posted in Agile | 8 Comments

Refactoring legacy code

Lately my co-worker asked me to pair with him and make a code review with him of one of his projects. After having spent some hours on refactoring this legacy application together with my co-worker I want to share some … Continue reading 

Also posted in Rant | Leave a comment

Favor Defect Prevention Over Quality Inspection And Correction

In the manufacturing world, you would never find a company that assembles a bunch of parts into a final product before inspecting any of the individual parts, and they would not wait until the end of the assembly line to … Continue reading 

Also posted in C# | Leave a comment

PTOM: Descriptive State Enumeration

This post is part of the November 2008 Pablo’s Topic Of The Month (PTOM) – Design Patterns and will primarily outline the State pattern, with an Enumeration or Descriptor pattern thrown in for good measure. Switch statements and if-then statements … Continue reading 

Also posted in VSTS | Leave a comment

Finding Design Smells In Non-Design Related Places

In my last post, I talked about the idea of encapsulation and using it to ensure that our business rules were enforced correctly. What I didn’t talk about, though, was the second half of the conversation that my coworker and … Continue reading 

Also posted in Tools | Leave a comment