-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Description
I've implemented a version of Dagger's Lazy<T> in Sangria. But it's somewhat limited; Lazy<Dependency> works automatically but @Annotated Lazy<Dependency> requires you to explicitly add a binding. That's about as good as an extension can do. There are some alternatives:
- Have Guice support its own
Lazy<T>out of the box, in a similar way to howProvider<T>injection works now. - Have Guice expose some kind of support for "pluggable bindings." Then I could write something like
bind(new LazyKeyMatcher()).to(new LazyGuicePlugin())and the plugin would generate bindings on the fly.
Is there any interest in doing something like 2? If so I can code up a proof of concept.
Metadata
Metadata
Assignees
Labels
No labels