My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
ExternalDocumentation  
Blogs, articles, books on Guice.
Updated Oct 16, 2011 by sberlin

External Documentation

Books

Dependency Injection by Dhanji Prasanna

In a traditional object-oriented application, a primary program controls secondary pieces of code, such as classes in a module, library, or framework. Dependency Injection (DI) is a technique that inverts this control, using an external mechanism to insert—or inject—a reference to an implementation of a service into an object. This allows you to build complex OO applications in a more testable, maintainable, and business-focused manner.

Google Guice by Robbie Vanbrabant

Google Guice: Agile Lightweight Dependency Injection Framework will not only tell you “how,” it will also tell you “why” and “why not,” so that all the knowledge you gain will be as widely applicable as possible. Filled with examples and background information, this book is an invaluable addition to your knowledge of modern agile Java.

Videos

Big Modular Java with Guice

An introduction to Guice by Dhanji R. Prasanna and Jesse Wilson, at Google I/O 2009.

Learn how Google uses the fast, lightweight Guice framework to power some of the largest and most complex applications in the world. Supporting scores of developers, and steep testing and scaling requirements for the web, Guice proves that there is still ample room for a simple, type-safe and dynamic programming model in Java. This session will serve as a simple introduction to Guice, its ecosystem and how we use it at Google.

Introduction to Google Guice: Programming is fun again!

PDF slides from the sold-out technical session at JavaOne 2009.

Articles

Dependency injection with Guice by Nicholas Lesiecki

Guice is a dependency injection (DI) framework. I've suggested for years that developers use DI, because it improves maintainability, testability, and flexibility. By watching engineers react to Guice, I've learned that the best way to convince a programmer to adopt a new technology is to make it really easy. Guice makes DI really easy, and as a result, the practice has taken off at Google. I hope to continue in the same vein in this article by making it really easy for you to learn Guice.

Guicing Up Your Testing by Dick Wall

This article examines the simplest and most obvious use case for the Guice container, for mocking or faking objects in unit tests.
Also available in Portuguese

Squeezing More Guice from Your Tests with EasyMock by Dick Wall

It should be apparent that making Invoice something that Guice creates directly is an incorrect design decision. Instead, you can mix it with another pattern instead: Factory.

Blogs

Guice with GWT

Configure your serverside app to serve up a backend for GWT apps.

Obtain the Guice JAR files, extend GWT’s RemoteServiceServlet, extend Guice’s GuiceServletContextListener, extend Guice’s ServletModule, set all RemoteService relative paths to GWT.rpc, and configure GuiceFilter and your context listener in web.xml.

Refactoring to Guice: Part 1 of N

Guide for migrating from factories to dependency injection.

In this N-part series, I'm attempting to document some patterns for improving your code with Guice. In each example, I'll start with sample code, explain what I don't like about it, and then show how I clean it up.

What's a Hierarchical Injector?

The premise is simple. @Inject anything, even stuff you don't know at injector-creation time. So our DeLorean class would look exactly as it would if EnergySource was constant:

TypeResolver tells you what List.get() returns

What the new methods on TypeLiteral do.

Simpler service interfaces with Guice

A brief discussion on contextual APIs.

Guice AOP Example

  @Trace("note goes here")
  public void bye() {
    System.out.println("see you later");
  }

Alternative way to integrate Guice with Wicket

Explains a better way to integrate Guice and Wicket, using Guice 2.0 and ServletModule which allows you to get rid of even more XML in your projects!

Comment by project member limpbiz...@gmail.com, May 20, 2009

FYI, this list is totally a work in progress. Post links to your best Guice docs in the comments!

Comment by tao...@gmail.com, Jun 16, 2009

I have written a tutorial on how to do multi binding in Guice. It covered bind multiple instances of same type, bind a set, map list and decorator, also how to use Guice to provide extension point. The url is: http://taowen.blogspot.com/2009_06_16_archive.html

Comment by John.Jian.Fang@gmail.com, Jul 9, 2009

I have created a wiki page to share my experience with Google Guice at

http://code.google.com/p/sacct/wiki/SAcctServerImplementationExperienceWithGoogleGuice

Comment by Joachim.Pfaff@gmail.com, Feb 20, 2011

Hi, the slides for "Introduction to Google Guice: Programming is fun again!" are now located in an archive which you can download at: http://download.oracle.com/javaone/javaone2009-core-se.zip

Comment by jsonn...@gmail.com, Apr 12, 2011

The link "Dependency injection with Guice by Nicholas Lesiecki" on this page is broken. Returns a 404 page.

Comment by ogregoire, Apr 13, 2011
Comment by jrop...@gmail.com, Feb 9, 2012

Here is a blog post on how to write Guice extensions: http://developer.vz.net/2012/02/08/extending-guice-2/


Sign in to add a comment
Powered by Google Project Hosting