vipx / google-guice

Automatically exported from code.google.com/p/google-guice
Apache License 2.0
0 stars 0 forks source link

Disallow conflicting scopes for linked bindings #51

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
If you have

 bind(Foo.class).in(SomeScope.class);
OR
 @SomeScope class Foo {}

then the following

 bind(Bar.class).to(Foo.class).in(SomeDifferentScope.class);

has underspecified behavior and we may lack the means to do anything smart
about this.  I think we should prohibit "rescoping" like this.

Original issue reported on code.google.com by kevin...@gmail.com on 2 Mar 2007 at 8:20

GoogleCodeExporter commented 9 years ago
We should just prohibit narrowing the scope, right? For example, trying to make 
a
singleton request-scoped wouldn't be allowed.

Original comment by crazybob...@gmail.com on 2 Mar 2007 at 8:57

GoogleCodeExporter commented 9 years ago
We've been referring to conflicting scopes as 'scope overrides': We always 
prefer the binding DSL over the 
annotation. It provides a convenient mechanism to rescope a class.

Original comment by limpbizkit on 30 May 2008 at 7:31