Sorry im using chrome and it suddenly posted  :)

OK anyway, what i was saying

@Provides
        @Exposed
        @Named("boxer1")
        public MovingRagdoll exposeRagdoll() {
                return boxer;
        }
public void configurePrivateBindings() {
                super.configurePrivateBindings();
                
expose(MovingRagdoll.class).annotatedWith(Names.named("boxer1"));
    }

Looks very clumsy to me and its not obvious to anyone why it's
necessary.  (with the extra @exposed @Named function

Why not ?

public void configurePrivateBindings() {
                expose(MovingRagdoll.class).annotatedWith(Names.named
("boxer1")).toInstance(boxer);
 }

Problem with the @Exposed @Named notation is that you cant reuse your
module, you have to write another module that injects (exposes) to
another name.

expose(MovingRagdoll.class).annotatedWith(Names.named(nameOfBoxer); is
reusing..

Hope this is clear.
--~--~---------~--~----~------------~-------~--~----~
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