New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support more binding dimensions #55
Comments
From crazyboblee on March 07, 2007 14:32:03 That should read, "right now, we match injection points to bindings using only the |
From bslesinsky on July 07, 2007 17:32:00 Maybe the module could ask for this: bindAllSuperTypes().to(FooImpl.class). But I could see this getting banned by some style guides for similar reasons as |
From limpbizkit on May 30, 2008 00:39:03 If the type hierarchy is this: Status: New |
From sven.linstaedt on June 16, 2008 10:24:05 -1 for suggestion #1 +1 for suggestion #2 |
From sberlin on May 02, 2010 05:52:17 Moves Guice a bit too far into the classpath-scanning land. It would be pretty easy Status: WontFix |
From crazyboblee on March 07, 2007 17:30:57
type A extends B, we have a binding to A, and we need a B, we could use the
binding to A.
This would enable you to write:
bind(FooImpl.class);
instead of:
bind(Foo.class).to(FooImpl.class);
This could make debugging a little more difficult as it adds another
dimension of magic.
scopes. This would add yet another dimension to the search for a matching
binding. For example, you could do something like this:
@
Inject@
SessionScoped User user;Perhaps we should do away with the idea of a Key altogether. A binding
would consist of the type, annotation, scope, etc. We would index on all of
these attributes. Then we would search for a best match to a given
injection point.
This could get tricky very fast. Right now it's very easy for a user to
look at an injection point and then find the exact binding which matches it.
Original issue: http://code.google.com/p/google-guice/issues/detail?id=55
The text was updated successfully, but these errors were encountered: