On Wed, Apr 20, 2011 at 9:18 AM, Stuart McCulloch <[email protected]> wrote:
> On 19 April 2011 15:42, Brian Pontarelli <[email protected]> wrote: > >> Could you use cross-injector providers? The Provider would have an >> instance to its plugin's Injector and then be bound into dependent plugin's >> injectors. This could require some lazy loading of injectors and maybe some >> proxies depending on how your dependencies map and if you have circular or >> other oddities in your graph. >> > > +1, that's basically the approach I use in Sisu [ > https://github.com/sonatype/sisu] > > Each plugin has its own Injector populated with bindings by doing local > classpath scanning. Scanned bindings are analyzed using the Guice SPI, and > any missing (ie. non-local) dependencies are satisfied by binding the > appropriate key to a Provider that delegates to a dynamic Locator. This > Locator knows about the available plugins and their bindings, again using > the SPI, and can dynamically match requests to components. > > You have to be careful about introducing too much magic, but that's where > the SPI can help by making it easier to analyze :) > Thanks Brian & Stuart for the suggestions, using a cross-plugin-injector provider does sound like the way to go and the same style of provider for accessing existing spring based plugins would also allow us to incrementally move from spring to guice. Regards, Jolse -- 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.
