views:

666

answers:

7

I've spent the past day or so designing a set of classes to parse in some events from a telephony system and then log them to a database. Having created 5 of the dozen classes I figured I'd need to parse the event parameters into a hashtable figure out what the event was and create an insert statement. (A base class and interface for the event and event data classes that hold all the event data + factories...)

I Had an epiphony that the whole design was a bit complicated for what it needed to do as there was no manipulation of the events at all.

I've redesigned it down to three methods that take event headers and data and return an insert query...

So I guess Occam's Razor strikes again...

What is your biggest over complication of a simple probelem? And when did you have that "forehead slap" moment when you realised you'd over designed it to high hell?

+7  A: 

Making abstract classes before I had more than one subclass in mind for them. It sounds trivial, but you end up making all sorts of assumptions about the behavior of "future" classes which may or may not ever be written, and these assumptions generally end up being wrong.

Nik Reiman
+2  A: 

The biggest mistakes I've ever made usually come from not using existing technology implementations that exist but rolling my own (because the existing solution isn't well publicised, etc). So yeah, reimplementing a subset of HTTP when I could have used HTTPClient when developing a RESTful service (back when I didn't know what REST stood for).

JeeBee
+2  A: 

I had a week time for implementing a Proof of Concept for a Integration Gateway from one System to another.

I started by programming a CommandExecutionService which execute several complex Commands in pararell through a ThreadExecutionService.

Then I made some sample commands, like wait 10 seconds, or print a random number.

And today I realised: The integration is as simple as parsing a result set and send some messages to a queue and get some messages from a queue and making an sql update out of it. And it gets deployed in an WAS anyway.

So I'm sitting now here with around 30 classes full of code, to make something could be done in 200 lines...

Next time I hack it in Perl.

Andre Bossard
+4  A: 

More of an over-troubleshooting than an over-design, but when I was a kid, Dad and I spent several weeks building what was, to me, a fairly complex and sophisticated model train layout. We planned to make an "event" of the train's maiden voyage. When everything was finally "just so," we plugged in the transformer, pushed the throttle forward, and were embarrassed to watch the train go backwards.

We were about to grab the tools and start rewiring when Mom suggested, "Why don't you just turn the train around."

Sheesh.


Edit: I expect, years later, that my children will solve the same problem by flipping the sign bit.

Adam Liss
+1  A: 

Building in the COM-based VBScript engine and thinking end-users would actually use it.

kenny
+7  A: 

I used PHP once.

FlySwat
+1  A: 

I was making a batch script in windows to defrag my HD and shutoff, so at the end of each day I could just click the icon and it would do everything for me.

unfortunitly, it was 3 in the morning and I got the 'defrag' and 'format' commands confused.

Yeah, that wasn't very fun waking up to 'Operating system not found' on the screen.

not really overdesign but too funny to not upvote. I remember using the deltree on c:\ when i meant to be in c:\temp...d'oh!
Mauro