This shows you the differences between two versions of the page.

Link to this comparison view

lazy_binding_with_guice [2017/07/14 08:38]
lazy_binding_with_guice [2021/04/05 11:23] (current)
Line 1: Line 1:
 +====== Lazy Binding with Guice ======
 +Everything in Guice is bound immediately. You cannot specify something like //lazy binding//. But what you can do is not binding to the desired object itself but to the provider of the object:
 +private Provider<Client> clientProvider;
 +By this way you can choose when to retrieve the desired object when need at not at object instantiation.
 +{{tag>devel java guice}}