Ok! Imagine I have several bindings for ISomething :
ISomething @Named("morning") --> SomethingMorningImpl
ISomething @Named("midday") --> SomethingMiddayImpl
ISomething @Named("evening") --> SomethingEveningImpl
At runtime, I know what time is it and I wish that the proper instance is
injected according the time:
public class MaClasse {
@Inject
@Timed
private ISomething something;
}
I'd like that Guice call me when it tries to inject, and so I will return
the "better" instance.
As you see, the framework is not able to decide alone in that case. But if
it is possible to plug behaviour at injection time, this case can be
resolved.
Hoper I'm clearer :-p
Regards,
Anthony
2010/1/19 Fred <[email protected]>
> Could you please give an example? I'm having a hard time interpreting
> what you mean.
>
> On Jan 19, 8:15 am, Anthony MULLER <[email protected]> wrote:
> > Hello,
> >
> > I can't remember... I work with Guice 1.0.
> >
> > Is is possible to take the hand when it is written:
> >
> > public class MaClasse {
> >
> > @Inject
> > private ISomething something;
> >
> > }
> >
> > I'd like to write a specific resolution, to choose the "best" binding....
> >
> > Thanks,
> > Anthony
>
> --
> 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]<google-guice%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-guice?hl=en.
>
>
>
>
-- 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.
