xiaodududu / google-guice

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

Multibinder should supply Set<Provider<T>> #414

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
and possibly Map<K, Provider<V>> too.

Original issue reported on code.google.com by dha...@gmail.com on 19 Aug 2009 at 6:32

GoogleCodeExporter commented 9 years ago
Jesse correctly points out that we cannot make a Set<Provider<T>> coz it 
doesn't make sense to call hashCode() 
and equals() on non existent values.

The map is already working.

Wondering if we should support List<T>

Original comment by dha...@gmail.com on 19 Aug 2009 at 7:16

GoogleCodeExporter commented 9 years ago
Does it make sense to support List<T> if the order is arbitrary? And clients 
who want a list can always inject the 
set and slurp it into a list of their own.

Original comment by net...@gmail.com on 19 Aug 2009 at 12:22

GoogleCodeExporter commented 9 years ago
The order is not arbitrary, it is faithful to the lexical order of bindings in 
installed modules.

Original comment by dha...@gmail.com on 19 Aug 2009 at 1:02

GoogleCodeExporter commented 9 years ago
I don't really want to support a List, otherwise things like the "first 
element" become even more significant, which 
makes module-management much more complicated.

Marking as closed, since I believe permitDuplicates() and Map<K, Provider<V>> 
satisfy user's needs.

Original comment by limpbizkit on 19 Aug 2009 at 3:24