Comment by [email protected]:
The (supposed) "commonly called" robot legs problem seems to be a direct
result of Guice's main "unit of work" or (perhaps better put)
its "fundamental building block" which is, the dependency. Notice
the "bind" takes the dependency and then what satisfies it.
The "instance" isn't considered until you ask Guice to 'get(an)Instance'.
This makes it great for systems where the object graph is a core set
of "Services" (that can be represented by Singletons per class) but for a
system based on the orchestration of components, DI frameworks that start
with the instance (bean) are much more flexible.
Guice needs an overhaul at the fundamental level to fix this. In Spring
this isn't even an issue since you would simply have two beans, both of
class Leg, one with an id of "rightLeg," and one with an id of "leftLeg,"
and they are independently configured with their own dependencies.
I find this really frustrating and I'm hoping someone can tell me I'm wrong
here.
For more information:
http://code.google.com/p/google-guice/wiki/FrequentlyAskedQuestions
--
You received this message because you are subscribed to the Google Groups
"google-guice-dev" 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-dev?hl=en.