My module:
bind( Translator.class ).to( TranslatorImpl.class ).in( Scopes.SINGLETON );
Now I expect to get the same instance every time I do
Injector injector = ...; injector.getInstance( Translator.class );
But if I do
injector.getInstance( TranslatorImpl.class );
I get a new instance every time. Is this a bug or an expected behavior?
java dependency-injection guice
ashitaka
source share