google-code-export / google-guice

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

AssistedInject and MapBinder api conveniance in method parameters #368

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I find it a bit unfriendly that FactoryProvider.newFactory(A,B) only takes
A=B parameters. I.e. either

FactoryProvider.newFactory(TypeLiteral,TypeLiteral); or
FactoryProvider.newFactory(Class,Class);

but not mixed. It happens that one of this classes is simple and the other
is not. I think it is convenient to have the ability to have also

FactoryProvider.newFactory(Class,TypeLiteral);
FactoryProvider.newFactory(TypeLiteral,Class);

methods. Why bother with TypeLiteral if not needed?

Same goes for MapBinder.

Patch is attached.

Original issue reported on code.google.com by alen_vre...@yahoo.com on 5 May 2009 at 12:04

Attachments:

GoogleCodeExporter commented 9 years ago
FactoryProvider is deprecated in favor of FactoryModuleBuilder (see 
http://google-guice.googlecode.com/svn/trunk/javadoc/com/google/inject/assistedi
nject/FactoryModuleBuilder.html ).  For MapBinder, it's easy enough to create a 
TypeLiteral out of a class [TypeLiteral.get(Class)] that it doesn't warrant the 
new methods.

Original comment by sberlin on 22 Oct 2010 at 3:47