O'Reilly logo

Learning Google Guice by Hussain Pithawala

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3. Diving Deeper in Guice

With basics of Guice covered, we are now ready to get into more challenging cases in the application development. These issues are addressed with the Guice features such as Providers, Binding collections, and Scoping. These are discussed in detail with several examples. Examples are available for these discussions in flights_3_1 and flights_3_2.

Going the extra mile with Providers

So far, we have worked with directly injecting dependencies. Yet, there are a few cases where injecting direct dependencies may not be an appropriate choice. Let's discuss such scenarios, and figure out how a Factory style Provider class provides a better way to inject dependencies.

Need for a Provider

Guice provides an instance by invoking ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required