--
You received this message because you are subscribed to the Google Groups "google-guice-dev" group.
To post to this group, send email to google-g...@googlegroups.com.
To unsubscribe from this group, send email to google-guice-d...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-guice-dev?hl=en.
Awaiting a Guice committer to take action on my mails to the list on
2010-07-03, entitled "Merge Request: 2.0-maven" and "...and then update
the POMs for 3.0".
Max.
To unsubscribe from this group, send email to google-guice-d...@googlegroups.com.
Filed issue 525
http://code.google.com/p/google-guice/issues/detail?id=525
--
Oh, I didn't realize that it had been implemented!If this method totally disables Guice's use of proxies (so that it never proxies an object as it did before, you will get the actual objects injected, always), then that is what I've been wanting since day 0! Thanks!Kind regards,Endre.
Btw, there have been talk of a dependency graph algorithm thing to go with this feature. Apparently Guice of before just instantiated the objects as it went along, proxying here and there if it didn't have the objects, not distinguishing between constructor and setter/field injecting - thus implementing a setter to "resolve" the fact that you were given a proxy didn't necessarily work out. Guice should rather instantiate after some logic; I guess building some kind of tree of the dependencies, instantiating the leaf nodes (those w/o dependencies) first, then going upwards. Any circle in the constructor graph should resolve correctly by having any of the classes in the circle implement a setter or a field injection taking the object(s) it depends on which is a part of the circle.Is this how it was implemented?
(I mean, you can't really inject until a dep is injected first anyway, so this ordering is natural).
So the "don't proxy" method is basically worthless, then?
It will pretty much always "crash" with "won't proxy" exception for anything but the basicest object graphs, and even sticking in a setter won't resolve it?
How much more time are we talking about here? When the Injector are made, you ONCE set up a tree/graph for how to construct each object, and that would take such a huge time? I can't seem to understand how that would influence Guice that radically to the negative.
2010/7/28 Endre Stølsvik <stol...@gmail.com>So the "don't proxy" method is basically worthless, then?
well the method does exactly what it says it will do - proxies won't be used to satisfy circular dependencies, so if there's a circular dependency then of course it will fail - but at least you'll get early knowledge of this in development and can then fix it accordingly
It will pretty much always "crash" with "won't proxy" exception for anything but the basicest object graphs, and even sticking in a setter won't resolve it?
have you tried it in practice? if you find a situation where a graph could be satisfied without using a proxy and it still fails then I'd log an issue with a testcase - then at least we have something concrete to discuss
How much more time are we talking about here? When the Injector are made, you ONCE set up a tree/graph for how to construct each object, and that would take such a huge time? I can't seem to understand how that would influence Guice that radically to the negative.
but imho that's something best left until after 3.0 is cut, otherwise the release will be even more delayed...
On Wed, Jul 28, 2010 at 11:48, Stuart McCulloch <mcc...@gmail.com> wrote:2010/7/28 Endre Stølsvik <stol...@gmail.com>So the "don't proxy" method is basically worthless, then?
well the method does exactly what it says it will do - proxies won't be used to satisfy circular dependencies, so if there's a circular dependency then of course it will fail - but at least you'll get early knowledge of this in development and can then fix it accordinglyThe point is that adding a setter method somewhere in the circular dependency cycle should fix the problem, right? Because then you'd start with that object S, which now obviously should be possible to construct (since it doesn't anymore require an object in the constructor which is part of a cycle). Then you'd construct up the other objects, and finally you'd end up with the object which must be set on object S using your newly added setter. This construction order must furthermore be the result whenever any object belonging to that circular dependency graph is requested.It will pretty much always "crash" with "won't proxy" exception for anything but the basicest object graphs, and even sticking in a setter won't resolve it?
have you tried it in practice? if you find a situation where a graph could be satisfied without using a proxy and it still fails then I'd log an issue with a testcase - then at least we have something concrete to discuss
I have not tried it yet, so this is purely from a theoretic standpoint: If the construction of objects still are made as it was, where Guice constructs objects as requested without any graph logic where setters are not treated as a possible way to break cycles, then this method won't achieve anything.Furthermore, since the construction order is indeterminate, you might get "explosions" by doing something seemingly unrelated in some module, or in some class - that is, even if it still should be possible to construct all objects without using proxies (by using the setters (or fields, obviously)).I will try to find time to test the current code.How much more time are we talking about here? When the Injector are made, you ONCE set up a tree/graph for how to construct each object, and that would take such a huge time? I can't seem to understand how that would influence Guice that radically to the negative.
but imho that's something best left until after 3.0 is cut, otherwise the release will be even more delayed...Well, I'm just sayin': If there is no attempt at doing "cycle resolution", then the new don't-proxy method is worthless.(But since Dhanji says that there is resolution in place, then maybe it already works?)