Category: guice

  • How to test the middle tier of a Spring application

    Since the advent of dependency injection (DI) as a staple of enterprise development using tools such as Spring or Guice, your code has become a lot easier to test. You no longer need to code up voodoo such as plugging in dummy resource locators or the like based on some random environment variable to tell…

  • What bugs me about Guice

    Last week I switched a basic Spring app to Guice, the new dependency-injection framework from Google. It’s nice, it’s quick, and it does what it says on the box, but one thing bothers me. I know it’s not really logical, but it’s like a rock in my shoe – I need to import com.google.inject annotations…

  • Dependency injection killed the factory pattern

    I was having a play with Guice (http://code.google.com/p/google-guice/), the new dependency injection framework from the folks at Google, and something quite profound happened. I realised that having used Spring for a while now, it had been ages since I had to code up a factory class for pretty much anything. No more weird JNDI lookup…