Guice injection

As we know what dependency injection is, let us explore how Google Guice provides injection.

We have seen that the injector helps to resolve dependencies by reading configurations from modules, which are called bindings. Injector is preparing charts for the requested objects.

Dependency injection is managed by injectors using various types of injection:

  • Constructor injection
  • Method injection
  • Field injection
  • Optional injection
  • Static injection

Get Java 9 Dependency Injection now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.