Hello,

On 10 Nov., 08:38, Matt Callanan <[email protected]> wrote:
> Can Guice support chaining delegates of the same interface together?
> E.g. For interface "Thing" I have classes BlueThing, RedThing,
> YellowThing.  BlueThing and RedThing both have a "Thing delegate"
> field.

I had the same requirement and asked a question on stackoverflow,
which got some answers:
http://stackoverflow.com/questions/7416974/how-to-create-recursive-object-graphs-with-guice

My final solution is also posted there. Basically I am using a special
annotation for the "Thing"
fields in BlueThing, RedThing etc. and bind the inner types to
Thing.class annotated with this
annotation and the outermost type (BlueThing in your example) to
Thing.class without annotation.

Hope this helps,
Philipp

-- 
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.

Reply via email to