Open GoogleCodeExporter opened 9 years ago
I understand that the best way to get around the circular dependency is to
inject a
provider to delay the creation of one of objects in the circular dependency.
I also noticed that circular dependency support is planned to be implemented
(http://code.google.com/p/google-gin/source/browse/wiki/GuiceCompatibility.wiki)
. Is
there an ETA for this?
Thanks.
Original comment by chris.k...@gmail.com
on 13 Jun 2009 at 8:04
Actually, from talking to Jesse Wilson the other day, it sounds like Guice's
support
for circular dependencies without using providers is an undocumented hack and
might
even go away (as a default anyway) someday.
One thing that is weird about Guice's magical circular dep breaking is that by
using
a proxy, you lose object identity in a way you might not realize.
Some details: http://code.google.com/p/google-guice/issues/detail?id=220
So I am inclined to not implement support for circular dependencies, though we
should
clearly detect this at compile time instead of blowing up at runtime.
Original comment by bstoler+code@google.com
on 14 Jun 2009 at 11:58
Thanks for the reply & feedback. I think what you are saying makes sense about
losing
object identity. Using providers is definitely provides a more clairvoyant view
of
object relations.
Original comment by chris.k...@gmail.com
on 15 Jun 2009 at 10:41
Is there any work being done on detection of circular dependency?
I ask because i'm having this problem from time to time, that by mistake i
create circular dependency. It would definitely help if gin would tell me that
im a moron instead of running for few minutes and then dying on
StackOverflowError.
Original comment by amster1...@gmail.com
on 12 Jun 2010 at 7:40
As far as I can tell, no one is working on this problem at this time.
Original comment by aragos
on 5 Jul 2010 at 12:51
I just hit this as well, and I think you got a point, Provider is safer.
Original comment by dusan.ma...@gmail.com
on 13 Dec 2010 at 3:18
Original issue reported on code.google.com by
aectann
on 8 Jun 2009 at 6:03Attachments: