Long-time refactor in the making

posted by Jeff | Sunday, March 15, 2009, 8:56 PM | comments: 1

Refactoring is the process of iteratively changing code to clean it up or alter its function. Awhile ago, I started to think about what it would take to make a photo album, like those found on PointBuzz, work in a more abstract way that would allow it to serve up photos and other photo-like things. And by things I mean DeepZoom images (see Hard Rock Memorabilia).

This kind of thing is largely a solved problem if you consider the many object-oriented design patterns that every OOP'er should know. A mix of interfaces and factories make this something I've done before, like with different controls in an insurance interview, for example. But for some reason, this one troubled me and I couldn't execute what I knew I had to do. I probably restarted the project a half-dozen times, and I annoyed myself.

Tonight I finally got it to a pretty good place. It's not serving DeepZoom pieces yet, but I know that it's not hard to get there from here (not hard, but still time consuming). I ended up really throwing away much of what I had done and let go of the legacy I had.

This, by the way, is something I encounter frequently with my own projects. I get so tied down to what exists, because I want to reuse the data. I often try to conform to the data instead of conforming the data to the new paradigm. It's always easier to port the data. I got stuck on CoasterBuzz for the same reason last year, wanting to preserve the way the databases worked instead of just starting over and figuring out how to port the data.

I think I'm doomed to write the same apps over and over.


Comments

Neuski

March 16, 2009, 3:56 AM #

I have encountered many problems at work where features were written around the poor data instead of the problem. The development is finally at a place where we are moving quickly away from the old way and storing the data in a much better way.

You would probably make a little poopy in your pants if you saw the text files that were being used to store data. Yucky!


Post your comment: