June 6, 2008

Going Overboard...

Well, I just wasted about 4 hours yesterday going down an architecture rabbit hole. In our latest project we are updating some ancient code to DotNet (as well as creating a whole new architecture), and have decided to use an IOC/DI container to handle creation of a lot of our objects. This solved a lot of problems with our dual views (a WPF view and a WinForms view) where things like timers were required (can't use a WinForms timer on an WPF window). I was so happy with the results that I decided to change a ton of ported code that was basically a bunch of global configuration operations to using the IOC container. Since the code was ported it had a ton of dependencies, which ended up being a ton of circular dependencies (this object used that object, etc) which I only discovered as I was moving them into the container. Either all of the configuration code was going to have to be re-written or I am going to have to wall off that section of the code and accept that it is going to have a bad code smell for now and refactor it later. I decided to revert the four hours of changes, and keep the project moving forward so that we don't have to spend a week refactoring the configuration for no real gain other than getting over the Ugh factor of the ported code. Now the project can move forward, make small progress, check-ins can occur regularly, the unit tests can be run. Maybe sometime in the future this will bite us in the ass, but for now I think it is the right decision.

Was the four hours wasted going overboard? Probably, but for every mistake you make, you learn something. And I probably won't waste four precious hours like that again.