On 7 March 2011 23:16, Philippe Beaudoin <[email protected]>wrote:
> I think the standard way to do that is to use Guice's SPI to inspect > non-bound types and provide the bindings yourself. +1, I use the SPI to find missing bindings and wire them up according to various rules (see the WireModule and Analyzer classes): https://github.com/sonatype/sisu/blob/master/sisu-inject/guice-bean/guice-bean-binders/src/main/java/org/sonatype/guice/bean/binders benefits include: * you can check everything up-front, make sure it's all consistent * the results can be cached or even stored in some persistent form * the results can be viewed using the Guice grapher extension, etc. the downside is that you can't add missing bindings that you don't know about until runtime (say based on some form of input) but then again maybe a factory/assistedInject would be the better choice for those situations... I've used a much more complex method in http://jukito.org but I plan to > reimplement all that with the SPI. > > Cheers, > > Philippe > -- Cheers, Stuart -- 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.
