mrszj / google-guice

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

LinkedBindingBuilder#toConstructor(Constructor, TypeLiteral) is not adequately documented #669

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The purpose of LinkedBindingBuilder#toConstructor(Constructor, TypeLiteral), 
and in particular the meaning of the second parameter, is not adequately 
documented.  The javadoc just says "See the EDSL examples at Binder", but there 
is no example there.

Reading the code, I see that the TypeLiteral supplies the type arguments for 
the object so that Guice can correctly compute the actual types of the object's 
dependencies and thereby choose the correct bindings to satisfy them.  That 
makes sense in retrospect, but it wasn't obvious.

Original issue reported on code.google.com by mattmccu...@google.com on 16 Nov 2011 at 3:01

GoogleCodeExporter commented 9 years ago
It's actually a semi-experimental feature that allows you to remove the need 
for @Inject on types and to bind sealed classes without a provider.

It's a fair call that it's not well documented. Will try and look into it.

Original comment by dha...@gmail.com on 27 Nov 2011 at 10:53

GoogleCodeExporter commented 9 years ago
I'd say it's out of experimental stage at this point, being in the latest 
release.  Definitely under-documented, though.

Original comment by sberlin on 27 Nov 2011 at 11:11