Thursday, July 05, 2007

When the Pattern Is Its Own Anti-Pattern

I'm totally digging Alex Miller's "Patterns I Hate" series.  So far he's taken down Singleton and Template Method.  I love to study patterns and "best practices" in general, but I realize they can do harm when slavishly copied in inappropriate contexts.

While on the topic of Patterns, I must give a shout out to my co-worker Geff Ivey.  I mentioned my liking of Design Patterns Explained as an alternative to the GoF, and Geff convinced me to finally take a look at Head First Design Patterns.  I'm sure this book isn't for everyone, but it was useful to me.  They finally helped me to wrap my head around Model View Controller.  They did it better than the Pragmatic Programmers, or Martin Fowler, although Fowler has more context on the evolution of the design.

Anyway, Alex appears to be a fan of dependency injection, which will soon be promoted by agile practitioners, as a cure for cancer, or at least cancerous code.  Alex has some excellent, thoughtful comments.  You should read them, highly recommended.

Enjoy,

++Alan

Sunday, July 08, 2007 11:41:43 AM (Eastern Daylight Time, UTC-04:00)
Thanks to prompting from Gabe(inanutshell.us), I have been working through the Head First book as well. I feel like that do a pretty awesome job explaining things. Although their examples are not always something that you can take straight to code, they focus more on concept than usability, I think. Anyway, a good place to start as opposed to the GOF or Design Patterns in C#, which focus more on implimentation than concept.
Sunday, July 08, 2007 3:28:10 PM (Eastern Daylight Time, UTC-04:00)
@Nathan Have you seen the Head First source code in C#?
http://www.msquaredweb.com/DesignPatterns/HeadFirstDesignPatternsInCSharp.zip

I view the GoF book as a reference. I would never recommend it as an introduction to patterns.

++Alan
Tuesday, July 17, 2007 12:06:43 AM (Eastern Daylight Time, UTC-04:00)

funny i just read a blog post by Jeff Bonwick, one of the ZFS engineers, talking about ZFS's "telescoping" approach to the data storage problem in response to an accusation by a Linux developer that ZFS was guilty of a "rampant layering violation":

http://blogs.sun.com/bonwick/entry/rampant_layering_violation

"layering" is one of those patterns that is just instinctual for most developers with any architectural sensibility at all, and yet we can go overboard with it sometimes, creating needless complexity and duplication, turning a pattern into an anti-pattern.

it seems that a common theme in a lot of these pattern-turned-anti-pattern scenarios is the revelation of some hidden complexity that results from the pattern ... complexity seems to a kind of meta anti-pattern ...

-dk
Comments are closed.