I'm using both, but I rarely mix the two.  So far I've only made Spring
bindings available to Guice (via
http://google-guice.googlecode.com/svn/trunk/javadoc/com/google/inject/spring/SpringIntegration.html).


I don't see any reason why Guice couldn't be configured within Spring: I'd
just question if it's necessary.  Perhaps someone else has more feedback.

On Wed, Feb 23, 2011 at 11:13 AM, zixzigma <[email protected]> wrote:

> Hello Everyone,
>
> I am using Spring framework on the serverside.
> SpringSecurity, REST, MVC, etc.
>
> however for DI I prefer to use Guice.
> with Spring 3.0, @Autowired can accomplish same thing as @Inject,
> but when writing my own code, I would like to use Guice, because of
> Providers, Assisted Inject, easier AOP, etc.
> I do not want to get rid of Spring IoC container entirely,
> because Spring uses it internally, but I would like to adopt Guice to use
> DI in my own code.
>
>
> - do you have any suggestion on this ? is this a bad idea ?
>
> - do you know how I can configure Guice within Spring ?
>
> My problem is bootstrapping Injectors, eg.
> Injector injector = Guice.createInjector(new MyModule());
> Foo foo = injector.getInstance(Foo.class);
>
> I believe Guice.createInjector should be created once during bootstrapping,
> When integrating with Spring, I would like to know specifically what I
> should register with Spring IoC.
> and do I have to use injector.getInstance(xxx.class) all over my code
> anytime I would like to get hold of a instance of a class ?
> if not, what is the purpose of injector.getInstance(xxx.class) ?
>
> Thank You
>
> --
> 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