Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Injecting Dependencies into Guice Objects

Header Image

  1. Constructor injection
    • This article covers constructor injection in Guice, including how to inject dependencies into a constructor and how to use the @Inject annotation on the constructor for automatic dependency injection.
  2. Field injection
    • This article explores the benefits and usage of field injection in Google Guice for injecting dependencies into an object’s fields, including examples of using the @Inject annotation to specify the binding for the dependency.
  3. Method injection
    • This article covers method injection in Google Guice, specifically how to inject dependencies into a method and how to use the @Inject annotation on the method.
  4. Injection with providers
    • This article covers how to use Guice providers to inject dependencies into objects in a Java application, as well as using the @Inject annotation on the provider class itself.

Table of contents