I also suggested to use @Provides(exposed=true) or @ProvidesExposed.
@Exposed feels like a binding annotation.
Robbie

On Mon, Dec 1, 2008 at 1:39 AM, Dhanji R. Prasanna <[EMAIL PROTECTED]> wrote:

>
> If we can avoid a new annotation I would be for it =)
>
> Dhanji.
>
> On Mon, Dec 1, 2008 at 11:11 AM, Mikkel Petersen <[EMAIL PROTECTED]>
> wrote:
> >
> > IT seems like the new updates behave differently. It's enough to just
> > declare a function @Provides @Exposed @Named and skip the
> > expose() method entirely ?
> >
> > On Nov 30, 11:53 pm, Mikkel Petersen <[EMAIL PROTECTED]> wrote:
> >> 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.
> > >
> >
>
>
>
> --
> http://twitter.com/dhanji
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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