On Tue, Feb 9, 2010 at 6:24 PM, Brian Pontarelli <[email protected]> wrote:
> Doesn't subclassing work? What issues are you having with that type of 
> solution?

I have a bad allergy to subclassing for this kind of reason, although
it does "work."  It would be nice if I could delegate instead.  Say
via an EDSL declarative like:

  using(OtherModule.class);

or:

  using(new OtherModule(parameter));

(Since we have only single inheritance in Java, sub-classing will
either break down by either failing to model a thing with two IS-A
relationship.  Alternately, if you push everything into one super, it
would become muddy since the super can't really delegate.)

I'm getting to the point where I'm thinking about how to build my
processors from sets of parameterized dependencies.  It would be cool
if I could:

  @Override
  public void bind() {
    using(new ConfigModule("fifth-third-ssl"));
    using(SSLTransportModule.class);
    using(Tandem610MessageFormatModule.class);
    using(RRNReversalStrategyModule.class);

    bind(ITenderProcessor.class).to(IPProcessor.class);
  }

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en.

Reply via email to