Saturday, February 15, 2014

Down the Rabbit Hole: Customer Contact...

I'm sure anyone who's ever found themselves designing or building anything will, in a spasmodic moment of perceived brilliance will come up with something that you later look back on with a feeling of "What the hell was I smoking???"

Moments like these can come at the most unexpected of times... Usually when you're starting to get on a roll... and you're confidence is building because everything seems to be magically falling into place.

My moment of insane idiocy came when I was closing out some of the smaller design components of the Customer Namespace and things in my mind just seemed to be clicking together.  Arrogance began to build as I started thinking - "Hey - I'm gonna knock customer out quicker than I think..."

I've often wondered if it's that combo platter of previous confidence based in accomplishment that raises the blinders to your design mantra:

KEEP IT SIMPLE STUPID!!!!

The irony of Customer Contact was that it's a very small simple component, but it would require possibly some management on the users part...

I can also tell, in retrospect,  where I jumped the rails...

A customer can have a contact, and a location can have a contact... but what if the customer doesn't have a contact???

One other added piece of self inflicted wounding was the fact that I had talked myself out of building a "Contact" namespace to rolodex all the contacts that could be involved in the system.  At the time - I really thought I was "Keeping It Simple Stupid" when I just said "Oh - just build a Customer Contact and store that crap there... don't over complicate it..."

With these two pieces in place... I set about building CustomerContact...  and that's when awesome progress turned into quagmire...

First I kept fighting with just the maintenance of the Customer Contact... providing order of importance (first contact, second contact, etc) and making sure there couldn't be duplicates... etc...

Then I fought with "How do you put a Contact on  Customer with no location???"

I then thought... OOOOOOOHHHH - I can just make CustomerContact hierarchal !!!  That solves the "order" problem, and I'll allow location to be null... Oh man I am SOOOO CLEVER!!!!

This is what it would have looked like:

While in reality - this isn't that overly complicated... it added a level of complexity to something that didn't need it...

What made me realize it was when I took a break from mapping out the logic, and decided... what would the Customer Management Form look like...


In working with the Node Tree... it became clear... and simple:

A Customer can't have a Contact without Location...
A Contact could exist on one or more Locations
A simple "Order By" field is a lot easier to maintain and code than Parent / Child...

Once those three facts entered my head... I scrapped my Customer Contact design, and pumped out the new one in 10 minutes...  Embarrassingly after a couple hours of being "clever"...

Lesson Relearned:  When in doubt... Draw it Out!!!  See if it still makes sense in the context of the larger picture...

The upside to Rabbit Holes:  There's usually cake and punch at the bottom once you're done tumbling down...

No comments:

Post a Comment