No scope will do exactly what you describe: create a new object for every
injection point.

Given A requires B and C; B and C require D: asking the injector for an A
will get you two instances of D: one held by a B the other by a C.

HTH
Ben

On Thursday, January 5, 2012, David Hoffer <[email protected]> wrote:
> This is probably obvious but...what scope should I use if/when I have
a state-full object but I want separate instances injected in each object
that takes that type in its constructor?  I.e. What scope do I use when I
want to guarantee that Guice creates a new object for every injection point
for that type?  If I do not annotate with any scope will
this guarantee this?  Or will Guice at its whim...sometimes reuse an
instance?
>
> --
> 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.
>

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