25 Jun 2008 13:15
Explicit service injection by service interface
Raffael Herzog <herzog <at> raffael.ch>
2008-06-25 11:15:46 GMT
2008-06-25 11:15:46 GMT
Hi, Sometimes there's no way but to explicitly inject services, mostly when there are two implementations of the same service interface. If the service should be injected into the constructor, having to do this has a major drawback: You'll have to inject *everything* explicitly, not just the amiguous service. Extending BuilderFactory a little bit could solve that problem: If we'd add something like <service-iface>my.pkg.MySerivceIface</service-iface> in addition to <service>my.module.MyService</service> it would be possible to explicitly specify the ambiguous service explicitlyx while still having HiveMind resolve the other ones. Cheers, Raffi -- -- The difference between theory and practice is that in theory, there is no difference, but in practice, there is. herzog <at> raffael.ch · Jabber: herzog <at> raffael.ch PGP Key 0x5FFDB5DB5D1FF5F4 · http://keyserver.pgp.com(Continue reading)
RSS Feed