Sounds like you want to build something custom that doesn't come out of the box. Shouldn't be hard to create your own factory implementation.
sam On Tue, Dec 2, 2014, 3:16 PM Guy Gadon <[email protected]> wrote: > Hello! > I'm trying to figure out a solution for this problem: > Let's say I have these classes: > > public class A { > @Inject > A(@Assisted String param){ > ... > } > } > > public class B{ > @Inject > B(@Assisted A) { > ... > } > } > > Now I would like to create a factory of class B, that will get the > parameter of A as the parameter of the factory's create method. > Is there a way of doing this without creating another level of > abstraction? (The another level would be to create my own factory that uses > both A's and B's factories...) > > It is important to say that I don't want to pass parameter of class A to > class B, it breaks the point of guice in a way. > > I've searched in some places, and saw some references about scoping, and > bypassing the problem in some ways, but nothing was actually useful. > > Thank you in advance :) > > -- > 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. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/google-guice/9da20dbe-3a8c-46ac-9eb3-30264edf6f3f%40googlegroups.com > . > For more options, visit https://groups.google.com/d/optout. > -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/google-guice/CAJEBNUe7GDfR%2BbTDPMo2n-%2BTsNNkacLZd%3D3sjYUpPvT2ABKg%3DQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
