Re: Overriding a module and reference a parent implementation

2015-02-07 Thread Stephan Classen
Maybe filter was not the best choice of a name. So don't let yourself be tricket by this. At the end the interface method is: List getUsers(List users); And the concrete implementation is absolutely free to add, remove or replace users from the list. Am 7. Februar 2015 18:10:14 MEZ, schrieb "A

Re: Overriding a module and reference a parent implementation

2015-02-07 Thread Philipp Wendler
Hello, Am 07.02.2015 um 18:10 schrieb Aurélien: > Yes exactly: I want a chain like behavior where the order of the modules in > the createInjector method determines the order in the chain. Then maybe a solution I developed some time ago helps you: http://stackoverflow.com/a/7544939/396730 It do

Re: Overriding a module and reference a parent implementation

2015-02-07 Thread Aurélien
Yes exactly: I want a chain like behavior where the order of the modules in the createInjector method determines the order in the chain. However, I think the Multibinder Set binder does preserve the ordering. Indeed, Multibinder is using an ImmutableSet which preserves the order from constructio

Re: Overriding a module and reference a parent implementation

2015-02-05 Thread Stephan Classen
So what you want is a chain like behavior where the order of the modules in the createInjector method determines the order in the chain. I don't think this is easily possible with the current guice extensions. Multibinder offers a Set and a Map binder. Neither of them preserves the ordering. Y

Re: Overriding a module and reference a parent implementation

2015-02-04 Thread Aurélien
Thank you for your responses. The OptionalBinder lead me to what I want : a plugin-type architecture. I could not reference a parent implementation with OptionalBinder. However, the Multibinder enable to add multiple implementations and to reference all these implementations. Although the Multib

Re: Overriding a module and reference a parent implementation

2015-02-04 Thread Stephan Classen
One thing that will not work is injecting A into either ASub or AOtherSub. Because this will create an endless loop sinc A is bound to ASub resp. AOtherSub. You need to be more specific and either request ACore or introduce a name for the parent so you could inject (@Parent A) Am 4. Februar 201

Re: Overriding a module and reference a parent implementation

2015-02-04 Thread Joshua Moore-Oliva
If I am understanding your use case correctly, it sounds like you may be interested in using the OptionalBinder that is new in guice4. It would allow you to set up a default binding (setDefault) in core, and then override that in a sub (setBinding). The javadoc is fairly thorough and has some e

Overriding a module and reference a parent implementation

2015-02-03 Thread Aurélien
Hi, I have a peculiar use case: - I have 3 libraries, Core, Sub and OtherSub - Sub and OtherSub do not know anything about each other, but they know the existence of Core - Sub and OtherSub override the same functionality in Core - In a project, I want to combine Sub and OtherSub. It does not wo