/kotlin-guice-examples

Examples of using Guice with Kotlin

Primary LanguageKotlin

kotlin-guice-examples

Examples of using Guice with Kotlin

This repo provides examples of using Google Guice with Kotlin.

Examples include:

  1. Simple injection using a module, mapping an interface to an implementing class
  2. Using the Singleton scope
  3. Injection mapping to an instance
  4. Injection using the @Provides annotation and a constructor method
  5. Annotation-based bindings
  6. Injection using a Provider class
  7. Injection using a MapBinder and a Factory so implementations can be selected at runtime
  8. Using Assisted Inject

For more information, see the comments in MainGuiceModule.kt

Running the example

$ mvn exec:java

Learning Guice