|
I would also use assisted injection http://code.google.com/p/google-guice/wiki/AssistedInject here a sample code: public class Foo { @Inject Provider<B> bProvider; @Inject AFactory aFactory; public void someMethod() { B b1 = bProvider.get(); B b2 = bProvider.get(); A a1 = aFactory.createA(b1); A a2 = aFactory.createA(b1); A a3 = aFactory.createA(b2); // more code } } public class A { @AssistedInject public A(@Assisted B b) } On 08/16/2013 05:16 PM, Nate
Bauernfeind wrote:
-- You received this message because you are subscribed to the Google Groups "google-guice" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-guice. For more options, visit https://groups.google.com/groups/opt_out. |
- a simple question ( after reading Dhanji's book) Jozsef Hegedus
- Re: a simple question ( after reading Dhanji's bo... Sam Berlin
- Re: a simple question ( after reading Dhanji's bo... Nate Bauernfeind
- Re: a simple question ( after reading Dhanji'... Stephan Classen
- Re: a simple question ( after reading Dha... Isaiah van der Elst
- Re: a simple question ( after reading... Jozsef Hegedus
- Re: a simple question ( after reading Dhanji's bo... Thomas Suckow
- Re: a simple question ( after reading Dhanji's bo... Isaiah van der Elst
