I humbly propose that these concepts are rather confusing in Guice

@Provides vs Providers

They both use similar mechanisms... IE providing the value of an object, 
but they do it differently and the semantics are confusing.

Also, Providers can provide either one object, or many... 

https://github.com/google/guice/wiki/InjectingProviders

Seems this is mostly done for lazy loading, or expensive loading , or 
creating a new object per get() call.

So when I see Provider<Foo> ... I don't know if that call is potentially 
expensive the first time.

I also don't know if I'm going to get one object (a singleton) or lots of 
them.  

Or if it's a rather simple object to instantiate it's just that we're doing 
so lazily.

Of course maybe I'm insane ;) ... which is entirely possible.

-- 
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 google-guice+unsubscr...@googlegroups.com.
To post to this group, send email to google-guice@googlegroups.com.
Visit this group at http://groups.google.com/group/google-guice.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-guice/771d742a-2e65-47dc-9277-75aedef448da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to