Guice Provider Concrete class binding example

Guice Provider Concrete class binding example

In previous tutorial Guice provider bindings example you saw how to use Google Guice provider interface in interface and it’s implementation model. This tutorial you will see how to get concrete class instance using provider interface:

  • Create HelloGuiceConcreteClass.java class:

  • HelloGuiceServiceProvider.java:

  • HelloGuiceModule.java which binds concreate class with its provider in singleton scope:

  • ProviderConcreteMainClass.java is java main class to test above functionality:

  • Output:

Guice Provider Concrete class binding example

  • For more information please visit Google Guice official documentation here

download  Download project:  GoogleGuiceProvider

Leave a Reply

Your email address will not be published. Required fields are marked *