I use Assisted Inject for this. Basically, assisted inject lets you cooperate with guice to create objects. Constructor parameters annotated with @Assisted are those you need to provide via a factory interface.
I hope this helps. -Adrian jclouds On Mon, Jul 6, 2009 at 9:24 PM, Lemao <[email protected]> wrote: > > After reading a bit more about Guice, maybe the right approach is to > define an explicit factory with a constructor receiving the global DI > object from Guice and a factory method receiving my contextual objects > to return a new instance. I would then inject the right objects and > the Injector itself into the factory constructor and inject the > factory into my classes. > > Let me know if there is a better approach. > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
