Hi!

I'm having problems with overriding bindings of PrivateModule.
Here is my example project:

http://pastebin.com/3BxUT90H

So i have 3 cars, each gets Transmission and Engine from CommonModule.

And i bind Driveline to each car separately with annotations, so each gets 
different class.
So standard robot leg problem/solution.

But now lets presume i have 10 different cars and i would like to change 
the Engine in just one module.
I could throw out Engine from CommonModule and define Engine in all 10 
modules.
But better solution would be to override Engine binding in just that one 
class.

How can i achieve this?

If i bind(Engine.class).to(PetrolEngine.class); in Module3 i naturally get 
A binding to Engine was already configured at.

Thats why we have Modules.override.

But   Injector injector = Guice.createInjector(
                commonModule,
                module1,
                module2,
                Modules.override(commonModule).with(module3)
        );

gives me the same error. 


So is there a way to define PrivateModul and override binding that is 
defined in AbstractModule?

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to