That's one way of doing it. I suppose it'd work, too, so long as provideFoo wasn't marked as a singleton (because we do want Foo to change through its lifetime). But, it has the sort-of-bad behavior of effectively creating two Providers for Foo, the ProviderMethod provider & the real Provider.
Sam On Tue, Sep 15, 2009 at 2:45 PM, [email protected] <[email protected]>wrote: > > Why not just call 'get()' on the returned provider at the end of the > method? > > Ie. go from this: > @Provides Provider<Foo> provideFooProvider() { > Provider<Foo> provider = ... > return provider; > } > > ...to this: > @Provides Foo provideFoo() { > Provider<Foo> provider = ... > return provider.get(); > } > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "google-guice" 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?hl=en -~----------~----~----~----~------~----~------~--~---
