frjaeger220 / google-guice

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

add convenience method for binding an instance to its own class #109

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I use tiny classes to implement flags, and often find myself writing this:

  bind(SomeClass.class).toInstance(new SomeClass(arg1));

It would be convenient to abbreviate it to:

  bindInstance(new SomeClass(arg1));

Original issue reported on code.google.com by bslesinsky on 26 May 2007 at 2:37

GoogleCodeExporter commented 9 years ago
I don't care for this - it encourages injecting concrete types, and 
toInstance(). 
  http://publicobject.com/2007/06/thoughts-on-java-as-configuration.html

Original comment by limpbizkit on 5 Jun 2008 at 6:23