Provider<T> maybe? 2010/2/4 Endre Stølsvik <[email protected]>
> Hi.. > > Guice uses "wrapping proxies" to resolve circular injections. > > However, trying to kill those problems by moving a constructor injected > parameter to a setter still does not seem to fix it. > > > I just made a MINOR change to a Module, not the rest of the code (I > actually went to use an instance-binding for one interface, instead of using > a "normal" binding), and *BANG* the whole damn system suddenly explodes > with 319 injection errors. What The Fsck?! > > And the "funny thing" is that the explosion is in a setter! (The setter > invokes some method on the instance which is injected - which IS NO > instance, just an empty shell of a proxy). How is that even possible, I > wonder? Why aren't at least the setter-injections deferred to the end of the > graph resolve algorithm? Or maybe there simply are no graph-resolve > algorithm - one do a simple linear (or random!) walk through the > configuration, "completing" each instance as one go along, using proxies at > any yet unresolved corner? > > > *My vote*, if it suddenly got tallied by someone, is firmly on the side of > letting the proxy-hell be configurable: For backward compatibility, let > Guice work as it does. But by setting some flag somewhere, Guice will NEVER > use proxies, and FAIL if there is any circularity. > > *I even believe Bob is with me on this one. :-)* > * > * > > PS: Make no mistake: I love Guice. > > PPS: All the 319 errors are from the same method. It seems every possible > injection in the whole system ends up needing the instance which crashes. > > Thanks, > Endre. > > -- > 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]<google-guice%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-guice?hl=en. > -- 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.
