May 30, 2007

Not Yet Guicy Enough

I finally looked into using Guice to wire dependencies for a pet project. If you're interested in evaluating it I recommend you read the TSS Guice debate. In the end I decided against it. The turn-off for me was the pain involved in wiring constant values to bean properties. Yuck.

I'm not convinced about mixing code and DI data. I like that Spring separates the two. On the other hand I dislike the way Spring XMLs tend to grow so large, and that refactoring tools can easily miss references to classes in the config XML.

So no Guice for me just yet.

2 comments:

Greg said...

Constant values you say ...
How about a little example mr Wizzard :)
Guice was on my "TO CHECK OUT" list, so I ask you for a bit more.
--
Greg "gigu" Gigon
http://blog.gigoo.org

Matt R said...

I made a similar decision with Guice. I'm not sure why I would add configuration in my code, when I could simply design the proper interface to my code to DI the configuration.

I'm still waiting for a compelling app, something akin to performance monitoring with Aspects, so understand guice's take on DI better.