I’m sympathetic to John Kerry when people call him a “flip flopper.” As an example of my own pathalogical flip flopping, look at my plans for this very Web site. Awhile back I said I was considering migrating to Movable Type. I installed Movable Type, I wrote a script to import my archives into it, and then I started hacking on the templates. Then I stopped and decided to just stick with what I have. A few weeks ago I decided to migrate to WordPress. I started hacking on the templates and working on an import script, then I stopped. My latest idea is to write a replacement for this package in Java, using Hibernate and the Spring framework. It’s going pretty well so far, and I have to say that from what I’ve seen up to this point, Spring is amazingly cool. Who knows whether I’ll finish the project, but if I do, I’ll stick it up on Sourceforge — I still have a project set up that was originally for the Perl/PHP stuff that powers this site. For my primary purpose — getting a feel for how Spring works without doing irreparable damage to the real projects I’m working on — the weblog software project is going great. The data model is based around the Atom API. I figured other people have already been doing the heavy lifting when it comes to weblog software data models, so it’s easier just to build on their work.
As far as the Spring framework goes, there are a couple of things that stand out as huge wins right off the bat. The first is the wrapper for Hibernate. I thought Hibernate was already pretty clean as far as APIs go, but Spring makes Hibernate even easier to use. I recently read Effective Java by Joshua Bloch, and it led to a total rethinking of how I think about checked exceptions (versus runtime exceptions). Spring’s wrapper of Hibernate turns a lot of checked exceptions into unchecked exceptions, making things adhere more closely to my thinking on how exceptions should work (more on that later, along with a review of Effective Java). I can also vouch for the degree to which Spring eases the development of unit tests. I can already tell that this application is going to be much more suited to full coverage with unit tests than an application I’ve ever worked on, and that’s due to the architecture that Spring encourages. Overall I’m very pleased, and I expect to add Spring to my standard set of tools immediately. I haven’t explored the Spring MVC features yet, so I can’t tell how well they compete with Struts yet.