Skip to content

dseurotech/understanding-guice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Project purpose

The tests in this demo project are meant to explain common usage and corner cases of Guice binding, autowiring, etc.

Running Order

This is the suggested running order:

  • Provising:

    • ProvidingStrategiesDemo: showcases guice module examples, and different strategies to provide collaborators
    • ProvidingEquivalenceDemos: showcases equivalent alternatives to provide a single collaborator
    • SingletonDemo: Different ways to provide a collaborator as singleton (or not)
    • MoreSingletonExamples: expands the use of Singleton providing
    • SetProvidingStrategies: on how to provide multiple implementations of an interface, grouped into sets
    • MapProvidingStrategies: on how to provide multiple implementations of an interface, grouped into a map, indexed by key
    • NamedDemo: when you have to provide multiple implementations of a common interface, and you need to choose which one to use
    • ConcreteBindingDemo: Demonstrate how to bind concrete classes, without relying on an interface
    • ImplicitInjectionDemo: Provided objects are automatically passed to other providing methods (a.k.a.: Linked Binding)
    • ProviderTest: Showcases the initialization sequence when using custom providers
  • Injection:

    • ConstructorInjectionDemo: Different constructor injection examples
    • FieldInjectionDemo: Different field injection examples
  • Overrides:

    • OverrideDemo: how to override provided implementation by using modules override
  • Stages:

    • InstantiationTimeDemo: When is a provided binding actually instantiated?
    • WiringValidationDemo: explains why you should always use Stage.PRODUCTION to validate your wiring

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages