[Play 2.4] Migrate to Guice or use spring integration?

138 views
Skip to first unread message

Vahid Zoghi

unread,
Jan 9, 2016, 10:04:01 AM1/9/16
to play-framework
I was one of the people who didn't migrate to Play 2.4+ because of the difficulty of integration with spring dependency injection. Has anybody successfully tried this process? I wan't to know if it would make more sense if I migrated to Guice once and for all instead of using one of the integration methods which seem neither easy nor clean.

Greg Methvin

unread,
Jan 12, 2016, 2:33:05 AM1/12/16
to play-framework
Hi Vahid,

I can't elaborate too much on Guice vs Spring for DI since I haven't used Spring enough. If you're mainly using Spring for DI it would certainly be worth checking out Guice. 

I do know that Guice allows you to bind your Spring beans, so that could be one route for people looking for an easy way to get things working in Play.

It should be possible to use any runtime DI container with Play, by using a custom ApplicationLoader in place of the default application loader, but I haven't seen a good one for Spring yet. James worked on a proof of concept for Spring integration a while back, but I'm not sure it's currently functional.

Vahid Zoghi

unread,
Jan 16, 2016, 9:12:20 AM1/16/16
to play-framework
Thanks. I successfully migrated to guice. It took a couple of days but the code is much cleaner than having both of them in the game.

Sagiruddin Mondal

unread,
Feb 13, 2016, 1:33:59 AM2/13/16
to play-framework
Hi Vahid, I am also trying to connect Spring Data Jpa with Play 2.4
Can you suggest me some good way to do that ?

Vahid Zoghi

unread,
Feb 13, 2016, 2:18:42 AM2/13/16
to play-fr...@googlegroups.com
Hi Sagiruddin,
I don't have any experience with Spring Data, but I guess if you are not using spring dependency injection, there shouldn't be any problem.
My problem was integrating spring DI with play 2.4 which by default uses Guice for dependency injection. And I chose to migrate completely to Guice

--
You received this message because you are subscribed to a topic in the Google Groups "play-framework" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/play-framework/VP8h6FAsR_o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to play-framewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/4c6e40e8-296c-43f3-adca-4bb829e43e15%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages