So now I'm trying this: > binder.bind(ITestAgentModule.class, > FTPTestModule.class).withMarker(FTP.class); > binder.bind(ITestAgentModule.class, > HTTPTestModule.class).withMarker(HTTP.class); > binder.bind(ITestAgentModule.class, > DNSTestModuleImpl.class).withMarker(DNS.class); > binder.bind(ITestAgentModule.class, > ICMPTestModuleImpl.class).withMarker(ICMP.class); >
Which throws an exception message indicating that the HTTPTestModuleservice (2nd defined) definition conflicts with the FTPTestModule (1st defined) service definition. It looks like markers aren't sufficient on their own and I still need * unique* service IDs for each implementation to successfully define my services. The only good I can see here is that I do not need to specify the service ID when injecting the service. So whats the benefit of specifying one in the first place ? On Wed, Oct 10, 2012 at 7:26 PM, Muhammad Gelbana <m.gelb...@gmail.com>wrote: > Actually the marker annotations would be the perfect solution. One should > always take care not to dive so deep into the problem that he can't observe > all possible solutions ! > > Thanks. > > On Wed, Oct 10, 2012 at 9:35 AM, Lance Java <lance.j...@googlemail.com>wrote: > >> Let's use a more concrete example. Let's say InterfaceA is Authorizer and >> InterfaceB is Listener and you want to call both of them "Managers". I >> don't >> think you should do this and I think tapestry is forcing good practices >> onto >> you. Your service ID's don't seem very descriptive to me. I think it's >> much >> better to have service ID's of "ManagersAuthorizer" and a >> "ManagersListener". >> >> On a slightly related topic, tapestry can use a service interface + marker >> annotation to uniquely identify a service if more than two implementations >> exist for a service interface >> (http://tapestry.apache.org/injection-faq.html). Perhaps you could create >> annotations for Users, Managers and Officers to do what you want? >> >> >> >> -- >> View this message in context: >> http://tapestry.1045711.n5.nabble.com/Suggestion-regarding-service-ID-tp5716740p5716752.html >> Sent from the Tapestry - User mailing list archive at Nabble.com. >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >> For additional commands, e-mail: users-h...@tapestry.apache.org >> >> >