The "simplest thing that can possibly work" approach would be
@ImplementedBy(DefaultA.class)
public static interface A { ... }
private static class DefaultA { ... }
and then you have a binding for A that is 'overridden" if a module
explicitly binds it.
If you're in a situation where it seems like something fancier is needed -
say, you want half the implementation of the default A, but a few methods
handled by B, then that's a good indication that you have a design problem
- a class which is doing orthagonal things and ought to be split up.
Probably a better solution would be to inject an object into A that does
the behaviors you want to vary, or get rid of A altogether and have two
types.
-Tim
--
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/d/optout.