Right I meant to say I only use Named if *different* implementations are needed.
Thanks, -Dave On Tue, May 10, 2011 at 5:21 PM, Maaartin G <[email protected]> wrote: > On Tuesday, May 10, 2011 3:30:17 PM UTC+2, dhoffer wrote: >> >> I think I'm starting to 'get' it. Having just one Module with the >> 'configuration' sure is a lot simpler. In cases where I need to map to a >> specific implementation I used this approach: >> >> @Named("MyImpl") >> & >> >> bind(IMyInterface.class).annotatedWith(Names.named("MyImpl")).to(MyImpl.class); >> > > Actually, you need Named (or another binding annotation) only if you need > *different* bindings in a single application. > > >> That seems pretty simple. I still think/hope the IDE can be smart and >> make sure that if I annotate with @Inject it will let me know and/or help me >> make sure all the parameters have been specified in the 'configuration'. >> > > I doubt it's possible. The IDE would need to do most of what Guice does at > startup. Moreover, it'll only assure that you bind it somehow - which can be > mostly achieved using @ImplementedBy and @ProvidedBy. It can't help you to > assure you did it correctly (since only you and your test cases know what > "correct" means). > > -- > 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. > -- 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.
