And constructor injection isn't possible for toInstance() 

Sent from my iPhone

> On Apr 8, 2016, at 1:51 AM, Laszlo Ferenczi <[email protected]> wrote:
> 
> The difference is who instantiates the class. 
> @Singleton will be guice instantiated (and therefore can participate in AOP 
> for example), toInstance() expects an instance which is already created, AOP 
> is not possible for this type of binding. 
> 
> --
> L
> 
>> On Fri, Apr 8, 2016 at 9:34 AM, Aleksey Matsarski <[email protected]> 
>> wrote:
>> What is the difference between bind.toInstance() and @Singleton? Will be the 
>> result - singleton for both? 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "google-guice" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/google-guice.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/google-guice/d7ad8464-afd0-40d0-ba55-0b84afcff2c9%40googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "google-guice" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/google-guice.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/google-guice/CAD-udUDHCd_3%3D-mGoQRw3sbkKO0RBATSPjNy_uamXeddvz8R9Q%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-guice.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-guice/34AACE7D-2E38-4722-B449-C0A0DFAC2B36%40pontarelli.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to