Dartboard-Driven Design
Saturday, May 30, 2009   

I swear. Sometimes I think certain software architects must have a dartboard, each segment containing a design pattern, you know, Adapter here, Observer there, Factory over there. When it comes time to design something, they throw a dart.

“Ooh, Memento!”

Like you, I'm a fan of classic Gang of Four design patterns. But all too often it seems like architects pick their design patterns out of a hat. "Hmm, I've never used Visitor before, let's try that." You could call it dartboard-driven design. Just pick your pattern and go!

When Kent Beck, Ward Cunningham, Jim Coplien, and the Go4 started identifying and codifying programming patterns some years back, probably not what they intended.

Design patterns were an application of the architectural theories of Christopher Alexander to the domain of programming, and Christopher Alexander is a seriously Roarkian kind of dude, and patterns in this sense are a Roarkian abstraction: a way of coalescing the ideal form of a piece of software according to its precise function. We can connect the dots from Ayn Rand's / Howard Roark's famous and universal statement of design, circa 1943...

Here are my rules: what can be done with one substance must never be done with another. No two materials are alike. No two sites on earth are alike. No two buildings have the same purpose. The purpose, the site, the material determine the shape. Nothing can be reasonable or beautiful unless its made by one central idea, and the idea sets every detail. A building is alive, like a man.

...all the way to the modern school of object-oriented, pattern-based software development, circa 2009. The problem is that these pesky design dartboarders have poisoned the well, to such an extent that some developers have sworn off patterns entirely. Unfortunately, because [insert cheesy end-of-post conclusion here] design patterns promote software health.

(No, seriously. I just want a Design Patterns Dartboard for my wall. Entire point of this post. Thanks for reading and let me know.)


Posted by James Devlin   21 comment(s)

Lulz James. I'll get right on that (the Wikipedia entry). By the way, I've got to have this dartboard for my cube. It would be an awesome piece of programmer schwag, and kind of a statement on software development as a whole. Make it happen.

JeremyX on 5/30/2009 1:33 PM (285 days ago)

I'll put one in the break room next to the Jump to Conclusions Mat.

Michael Bolton on 5/30/2009 1:47 PM (285 days ago)

I vote for the "Beer" design pattern, highlighted in red. Obviously inserted as a nod to yours truly.

Beer Me on 5/30/2009 3:25 PM (284 days ago)

awww, why isn't it a flash game? :-(

tim on 5/30/2009 6:26 PM (284 days ago)

Nice touch with KISS on the bullseye.

Anonymous on 5/31/2009 12:17 AM (284 days ago)

I agree about the bullseye did not see that at first.

You could possibly get in touch with ThinkGeek.com about the dartboard. Don't know if they consider "outside submissions" but there are always places like this which do custom dartboard printing:

www.dartboard-magnetic.com/custom-dartboard.html

I would certainly pay to have one of these in my cube.

Gordon on 5/31/2009 6:07 AM (284 days ago)

Design patterns were invented by the Gang of Four. Coplien had nothing to do with it, and Christopher Alexander, who wasn't even a programmer, had zero to do with it. Patterns were mostly a fad of the late 90s, hardly anybody bothers with them anymore.

Just FYI.

Arnold Kestler on 6/1/2009 1:48 AM (283 days ago)

@Arnold have you ever actually worked in a software development shop? Your comment is not only factually incorrect, it's lazy. Try actually working as a programmer before you sound off on things you (obviously) know nothing about.

Anonymous on 6/1/2009 4:37 AM (283 days ago)

The dartboard is somewhat epic in its geekery so I approve, even though I don't consider myself a patterns sort of guy.

You could also do this with programming languages, operating systems, etc.

krull on 6/1/2009 5:57 AM (283 days ago)

Love it.

Ed K. on 6/1/2009 1:21 PM (283 days ago)

I didn't even know some of these *were* patterns. I mean, "guarded suspension"?

I think one area where patterns are really coming into their own is in multiprocessing. Running across multiple cores/processors will foster a whole new wave of patterns, when it finally happens. Of course these patterns will probably be incorporated into the Clojure-esque set of languages that will dominate development once the switch to parallelism is made.

KGB on 6/1/2009 9:01 PM (282 days ago)

For those who may not be familiar with some of the hidden meanings above:

KISS at the center of the dartboard means:

http://en.wikipedia.org/wiki/KISS_principle/

Also, "Big Ball of Mud" isn't a formal pattern, but it's inclusion here is funny.

http://www.laputan.org/mud/

Great work as usual James. I like these little "filler" posts you do from time to time.

Anonymous on 6/1/2009 10:48 PM (282 days ago)

You should probably attribute that Fountainhead quote, as I think this is one not many people today are likely to have read.

Alquesh on 6/2/2009 8:23 PM (281 days ago)

Interesting article in the NY Times today (I noticed they linked to your earlier post on coin flipping, how did you manage that?). "The Demise of Form Follows Function".

www.nytimes.com/.../01iht-DESIGN1.html?_r=2

jrx on 6/2/2009 10:04 PM (281 days ago)

It seems like your poker-related posts are always a lot longer than your classical computer science posts. I'd prefer to see some in-depth discussion of classic computer science issues. Not that I have a problem with the short and sweet posts but it seems like your post length is a little lopsided.

Evan on 6/3/2009 7:35 AM (281 days ago)

Verbal-masturbation..

Are you building a house, or making something work?
Sure a "solid foundation" and all those parallels, and metaphors.
But you aren't making something more akin to a watch then you are a house?

I'm all for some sort of organization, but IMHO to much thought on the "how, when, and where" is counter productive.
Other things to consider? How easy is it to read and use by others?
I hate it when I see 10,000 lines of flowery text in headers, and very little substance?
If it's just you coding it (other then coming back and remembering what you did) who give's a $hite?

I'm just saying there are different view points.
I'm not advocating full on "cowboy", but then is it really necessary to always design everything to the n'th degree and must you label and try to categorize everything?
Coding some small program.. probably not. Coding the software for a bank, for the space shuttle, a kidney machine, then by all means do!

In my experience, the "star" programmer in the company is the guy who can get it done the FASTEST and in a reasonable way the boss/client wanted it. Not the guy sitting to him self, pondering over what "patterns" to use, what the right semantics, what the right labels are, how to abstract everything out ad nauseum; over engineered..

Like Bruce Lee, mine is the way of patterns with out patterns..

Baba Booey on 6/4/2009 8:28 PM (279 days ago)

I'm sure Microsoft engineers use this dartboard.

Badugi poker sites on 6/7/2009 9:50 PM (276 days ago)

Yes Microsoft engineers use this dartboard, but they throw at it blindfolded..

Born4Holdem on 6/9/2009 11:55 AM (275 days ago)

Awesome. I agree with the poisoned well comment.

Also, though, there needs to be more emphasis on "Pattern Hatching" (look for posts by Go4 member Vlissides) in the software design community.

The patterns catalogues are a place to start, but maybe your (customer's) problem has a solution that is not an obvious variation on the patterns in the catalogue.

The hark's to your Rand / Roark quote. Then you need to evolve the code to a new or hybrid pattern (i.e. hatch a new one).

And to show how old this line of thought really is:

Marcus Aurelius (philosopher and emperor of Rome 161 - 180 AD):
"Of each particular thing ask: what is it in itself? What is its nature?"

Now someone will find an older quote Smile

John Kavadias on 7/8/2009 9:13 PM (245 days ago)

'In my experience, the "star" programmer in the company is the guy who can get it done the FASTEST and in a reasonable way the boss/client wanted it.'

Yes, we have a few "stars" like this where I work. The get stuff done really quick, and they are worshipped by management. Pitty the unfortunate sod that has to maintain their code when they get moved on to their next staring role though. Seriously, it is more often that not a bunch of NASTY hacks.

Martin on 7/9/2009 4:49 AM (245 days ago)

I have the dartboard printed out and on the wall beside my computer. Nice reminder how design patterns are fun water cooler talk, but not the first place to turn.

There is one large issue with the dartboard however, Singleton should also be the white space around the dartboard ;)

Dustin Senos on 7/9/2009 6:14 PM (244 days ago)

Comment on this post:

Thanks for your interest in Coding the Wheel. All fields are optional.