Hey Dmitry --
Seems like you're really pushing the edges of parent injectors! AssistedInject is implemented using a child injector behind-the- scenes. This is required so that factory-created classes can participate in AOP. I'm curious about the duplicate binding errors - it was my goal that child injectors would be able to accomplish everything that their parent injectors could do. For example, asking that injector for a binding should just delegate to the parent injector. Could you shed some light on this? In any event, thanks for writing in with these issues. I'll do what I can to make things right. Cheers, Jesse On Jun 8, 3:55 pm, Dmitry Skavish <[email protected]> wrote: > If I have I class: > > class A { > @Inject A(Injector injector) {} > > } > > then when created this instance will hold a reference to our original > injector. > > If I have a class: > > class A { > @Inject A(@Assisted String name, Injector injector) {} > > } > > and create this class using assisted factories like this: > > interface AFactory { > A create(String name); > > } > > bind(AFactory.class).toProvider(FactoryProvider.newFactory > (AFactory.class, A.class)); > > then the injector which A received in its constructor is different > from our original injector and it seems it's not really a valid > injector because you can't do much with it, it throws exceptions > complaining about duplicate bindings all the time. I can provide all > those errors, but it seems to me that it all could be fixed by just > providing the correct (original) injector for factories created > objects. > > Anybody has any insights into this? Am I doing something wrong? > Thanks! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
