-bp
> --
> You received this message because you are subscribed to the Google Groups "google-guice" group.
> To post to this group, send email to google...@googlegroups.com.
> To unsubscribe from this group, send email to google-guice...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-guice?hl=en.
>
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.
On 19 April 2011 15:42, Brian Pontarelli <br...@pontarelli.com> 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 :)