xiaodududu / google-guice

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

Document binding deduplication #659

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I have a situation in a Google project in which I would like to modify several 
modules to all install a common module but have the common module installed 
only once, to avoid errors about duplicate bindings.  It occurred to me that 
MultiBinder must have a solution for this, and indeed it does: Guice 
deduplicates modules according to Object#equals.  This behavior is mentioned on 
a few blogs but is not officially documented in Guice anywhere I could find.  
Please document it, e.g., on the Module class or on Binder#install.

Original issue reported on code.google.com by mattmccu...@google.com on 7 Oct 2011 at 4:56

GoogleCodeExporter commented 9 years ago
In internal discussion, Sam pointed out that Guice also deduplicates bindings 
and this, not module deduplication, is considered the "primary" feature that 
Multibinder relies on (though either would work).  So I hereby change the RFE 
to "Document binding deduplication".  Unfortunately I cannot edit the subject.

Original comment by mattmccu...@google.com on 11 Oct 2011 at 6:00

GoogleCodeExporter commented 9 years ago

Original comment by sberlin on 11 Oct 2011 at 6:11

GoogleCodeExporter commented 9 years ago
Any suggestions for where binding deduplication should be documented?

Original comment by sberlin on 16 Oct 2011 at 3:50