Juiced about Guice

In my day job my coding time has become pretty limited. I've also recently been pretty uninterested in 'The Newest Thing'.

That all changed (for an hour) today as I downloaded and began to play with Guice. Guice is a dependency injection framework (similar in concept to part of Spring) from Google. It allows you to write self contained modular code that is easy to unit test, and 'clean'.

I found an hour or so to play with Guice yesterday to read through the user's guide and build a quick prototype. As I found myself working through the features, I had an overwhelming desire to go build something with it. It rekindled a fire.

This certainly isn't a comprehensive comparison of Spring and Guice, or a claim that Guice is th end-all-be-all, but I found its use of Annotations, Generics, and concise and flexible configuration code to be very interesting. It was certainly a much more exciting experience than when I first sat down with Spring's dependency injection code (and its XML).

It is limited to JDK 1.5, which I think is GOOD. Yes, it wouldn't work for everyone on every project, but as we learned from Apple, forcing people to upgrade and abandoning backwards compatibility can produce much exciting results.

On a larger note, I'm very excited to see Google start make major contributions to Java and Open Source. The Google Web Toolkit is still on my list of things to play with, and Guice has certainly moved up on my tinker list. I'm off to make up a project to generate an excuse to use Guice. Maybe I should finally do JES version 2.

No comments:

Post a Comment