Status: New
Owner: ----

New issue 716 by glenview...@gmail.com: requireExplicitBindings() method should support requiring explicit binding on individual classes
http://code.google.com/p/google-guice/issues/detail?id=716

I'm using a couple of different injectors and I want to ensure I don't accidentally access a class that's bound automatically from an injector, especially since its scope is important.

For instance if I have a method Foo that is "illegally" requesting a Bar:

class Bar { @Inject Bar() {} } // Shouldn't be accessible in Foo's injector
class Foo { @Inject Foo(Bar bar) {} } // Binding should fail here

Apparently, the only way to do this presently is to force a run-time error with a provider method.

I'd like Guice support to force an automatic binding to fail only on a specific class. I think it could work via requireExplicitBindings() with variable length parameter list of classes to prohibit.



--
You received this message because you are subscribed to the Google Groups 
"google-guice-dev" group.
To post to this group, send email to google-guice-dev@googlegroups.com.
To unsubscribe from this group, send email to 
google-guice-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-guice-dev?hl=en.

Reply via email to