2010/1/7 Andrey <[email protected]>:
> [...] If we need new
> instance every time we just use new, we do not usually need IOC for
> that. So it is very strange for me that Guice's default scope is
> "new".

You cannot compare Guice's "new" to constructor's "new".
Whether singleton scope, no scope or whatever scope, Guice will inject
all the dependencies for you, which is not the case when you just call
the constructor.
One should not mix application with "new" here or there (excluding
leaf objects), here is why:
http://misko.hevery.com/2008/09/30/to-new-or-not-to-new/
I am not sure, but I suppose that in my application "no scopes" are
even more common that singletons.
-- 
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