The art of failure
There comes a time when we know things aren't going rignt, the sooner we realise it the better, but only if we have the courage to act.
I am going back into the office tomorrow to admit I was wrong.. again. Having spent the weekend walking the dog and playing with the kids, the fog of war cleared and realisation dawned that I was fighting the wrong battle.
I am always keen to provide abstraction between architectural layers, in this instance I have won the argument about the need to decouple business logic and business domain representations from the Data Access and storage logic and relational schemas.
I usually go for NHibernate as the weapon of choice for providing a Data Abstraction Service, but with ADO vNext in the wings, I have spent some time looking at simpler interim solutions untill the brave new world ships with Visual Studio 2007.
Now, I finally decided that we could get away with a simple Code Generated Data Access Layer, and a hand carved layer of Mappers, to transfer state between the data and business models.
Spent last week putting this together, replete with functional and unit tests hoping to be able to move ahead, its not neat and its not pretty, but it works, kind of.
Anyway, to cut a long story short, it won't be easy to move forwards with what we have now, we do, after all need a propper OR Mapper, and Im going in tomorrow to chuck last weeks work away...oh, except for the tests.
This reminds of my Dad. He is a goldsmith, and works alongside my Mum. When she starts to make mistakes she soldiers on and tries to salvage as much of the work she has done. My Dad, on the other hand, chucks his work in the scrap pot as soon as it starts looking vaguely pear shaped, and starts again. - He always finishes first.
For me. the value of test first may have proved itself again. At least I can show that last week wasn't totally wasted, and I have the courage to chuck my hand wrought mappers in the scrap pot and start over.
Thanks Dad.
No comments:
Post a Comment