Chapter 1: Setting the Stage

You've probably heard about dependency injection (DI), and if so, you're in for a real treat: Guice (pronounced "juice") is, in my opinion, by far the most innovative framework in the problem space. Created by Google employees "Crazy" Bob Lee ( and Kevin Bourrillion (, this lightweight, open source DI framework is designed to bring true ease of development to the world of DI. Taking advantage of Java 5 features like no other application has before, Guice is the XML-free cure to hard-to-maintain code.

Before I start talking about using frameworks, DI, and whatnot, I think it's best to step back and take a look why initiatives like Guice exist in the first place. Obviously, ...

Get Google Guice: Agile Lightweight Dependency Injection Framework now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.