Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Circular Dependencies & Proxies
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Sam Berlin  
View profile  
 More options Jul 28 2010, 9:05 am
From: Sam Berlin <sber...@gmail.com>
Date: Wed, 28 Jul 2010 09:05:17 -0400
Local: Wed, Jul 28 2010 9:05 am
Subject: Circular Dependencies & Proxies

I think you are vastly overestimating the amount of times Guice will create
a proxy object.  Guice will continue working fine (without proxying) if
  a) there is no circular dependency at all,
  b) dependencies are injected using Provider<X> instead of X
  c) the the circular dependency is only within setters methods (not
constructors)
  d) if the circular dependency exists in the setter method of the first
constructed object (even if it's in the constructor of the second one).

Of those cases, the only one that could stand to be improved is d).  The
improvement would make it so that the proxies aren't constructed even if the
reverse situation is true (constructor in first object, setter in second).
But, given that there's other perfectly viable ways to fix it -- such as
injecting Provider<X> instead of X -- I'm not as down on the proxies as you.

If you absolutely want to forbid Guice from creating a proxy, because it's
ruining your logic, then use disableCircularProxies and tell Guice to
generate an exception whenever it was going to create a proxy.  Then look
through the code and re-arrange it (either removing the circular
dependencies, using Provider, etc..) so that Guice will not create a proxy.

sam

2010/7/28 Endre Stølsvik <stols...@gmail.com>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »