Tuesday, March 13, 2007

Google Guice 1.0 Released

Guice 1.0 has been released. Guice, as you'll see all over the internet at this point, is a Dependency Injection framework from the folks at Google.

That being said, there are plenty of lemmings out there who'll go running off the cliff for this; because it's from Google. So, guess what, I'm going to jump to, but I'm bringing a parachute.

I started trying to port over some simple code I have on my laptop from Spring to Guice this morning. The very first thing I noticed; is that there is no feasible way to inject an existing Pojo class (that is annotation-free) without writing a Provider class for every Pojo. So if you're using Spring framework classes (without the XML), such as JmsTemplate, HibernateTemplate, and JdbcTemplate, you better get used to writing Provider classes.
Read more here...

There is an alternative approach that involves building a Spring ApplicationContext from XML, and then bringing it into Guice using there SpringIntegration code. But once you've done that, what's the point?

I'm betting someone will come up with a good solution for this. It really is a nice framework, but the Pojo thing is very limiting.

Here's some links for more information...
crazybob.org: Guice 1.0
Guice at googlecode
My googlegroups post on the pojos

No comments: