I gotta know - How'd y'all think that was gonna come out?
Pattern Boy

UnFactor

Quit thinking outside the box!

About the author

Author Name is someone.
E-mail me Send mail

Recent posts

Recent comments

Authors

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2009

Pattern Boy

****You should read the post on Refactor Man to fully appreciate Pattern Boy**** 

This is Refactor Man’s protégé.  All great super heroes have to have a side kick, you know like Batman and Robin.  Except this is more like Dumbass and Dipstick. 

Pattern Boy has committed the GOF book to memory and can recite chapters on demand.  You can recognize Pattern Boy as he visits other developers on the project trying to explain how they should be using a template pattern instead of a switch statement.  What good is a single flow control statement when you could create a separate class for each case?  All those variables the switch had access to by ref can now be converted to properties on a class.  Why have the stack and heap if you are not going to pop and pull?  If we abstract carefully we can get each one of the classes can get down to just one line of code, how elegant is that?  Of course instead of the single switch with three cases we now have nine new classes with one line of code each.  I must admit the game of whack-a-mole you have to play to debug this stuff is amusing for about two seconds, but after that it just gets trifling.

When Pattern Boy is young and his powers still in the formative stages he is limited to the use of a single pattern at a time (he is still  a singleton).  As he matures and grows to understand his calling, he will begin to concatenate patterns across groupings; he will start to multi-thread.  Be on the lookout for “templatized commands” and “flyweight mediators.”  When you hear these you will know Pattern Boy is growing strong with the force of software failure.

As with nearly all cultures, there is a right of passage for Pattern Boy.  When he is able to use three patterns at the same time he will be allowed to hang out with Refactor Man in the tough section of cube town.  You will notice Pattern Boy’s absence from all the normal Fowlerite haunts as he prepares for the passage.  He can be found diligently studying the Fowlerite bible and scanning blogs for a pattern of patterns to use.  Never mind the pattern does not fit the problem that matters not, what is important is the use of the pattern.  It is preferable in these rituals to refactor (rewrite) another developer’s code and explain to said developer how ignorant he was not to notice the pattern of patterns.

You will know when Pattern Boy thinks he is ready as he will step off elevator and start shouting at the top of his lungs “ABSTRACT FACTORY CREATING TEMPLATES FOR ITERATORS” or something equally useless.  All the Fowlerites that have already achieved Refactor Manhood will well up with tears of pride and joy, all the other Pattern Boys will hang there heads in dejection as they realize they have yet to make the passage.  The agony and the ecstasy all in one microcosm of the virtual life.

Currently rated 5.0 by 3 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by pcoppney on Wednesday, January 23, 2008 7:45 AM
Permalink | Comments (2) | Post RSSRSS comment feed

Related posts

Comments

DotNetKicks.com

Sunday, February 03, 2008 7:16 PM

Trackback from DotNetKicks.com

Pattern Boy

KodefuGuru us

Monday, February 11, 2008 1:23 AM

"template pattern instead of a switch statement."

I'm a fan of the template method pattern. Switch statements are fine, unless you're doing it for the same values in multiple places. That's when you know you should switch to a more object oriented solution. Switch statements are smelly for a reason... they lead to duplicate code.

There's an evil counterpart to pattern boy... smelly boy. Smelly boy is Procedural Man's sidekick. I curse procedural man and his smelly code every time I'm forced to rewrite a program that has exactly one layer. Copy/Paste is bad, as is writing *all* your code in event delegates.

Add comment


 

  Country flag





Live preview

Saturday, July 04, 2009 3:02 AM