Comment #7 on issue 519 by limpbizkit: toProvider() should continue to use
Guice's Provider, not JSR-330's
http://code.google.com/p/google-guice/issues/detail?id=519
I agree with Sam on this.
Asking users to use the c.g.i.Provider when implementing the interface but
the j.i.Provider when injecting it is a recipe for disaster. Particularly
since there's plenty of code like this floating around:
class FooProvider implements Provider<Foo> {
@Inject Provider<Bar> barProvider;
@Inject Provider<Baz> bazProvider;
public Foo get() { ... }
}
It would be a huge loss to legibility if we demanded c.g.i.Provider on the
implements clause and j.i.Provider on the injections.
The only thing that has me anxious here is the binary compatibility on
methods like .toProvider(Provider). I personally wouldn't be offended if
Binder exposed 1 extra method for receiving the provider instance.
Ideally new users should be able to abandon the c.g.i annotations
altogether!
--
You received this message because you are subscribed to the Google Groups
"google-guice-dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-guice-dev?hl=en.