Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grails or Play! for an ex-RoR developer?

Tags:

I plan to start learning a Java web framework (I love the Java API) I have already used Rails and Django.

I want something close to Java but without all the complexity of J2EE.

I've found 2 frameworks that could be good for me:

Grails

Grails looks great, it uses Groovy which is better than Java for web application (I think..) but it's slower than pure-java based frameworks (Hibernate, Strut, Spring) It looks pretty simple to deploy (send .war and it's ok!), the GSP is great! It's a bit harder to debug (need to restart the server at each modification and stacktraces contain a mix of Java and Groovy traces which is not always the easiest to understand)

Play!

This framework also looks great; it's faster than Grails (It uses Java) but I don't really like how it uses Java, it modifies the source code to transform the property calls as setXXX/getXXX, I do not like that... The framework also has a caching function that Grails does not have. I don't really like the Template Engine. It's also easer to debug (no need to restart the server, stacktraces are clearer)

What do you recommend? I am looking for something easy to learn (I have a lot of Ruby experience, not so much Java experience but I love the Java API), fully featured (That's no a problem with all the Java Library available, but if it's bundle and integrated I prefer), has good scalability and is not too slow (faster than Ruby) Ideally I would like to use a framework with a decent community to easily find support.

PS: I am not interested in JRuby on Rails

like image 725
Kedare Avatar asked Mar 27 '10 17:03

Kedare


3 Answers

I switched from Grails to Play and I never looked back. My biggest problem with Grails was overall robustness and developer usability. Most of the time I got bitten by the fact that Grails glues together the usual stack of Spring MVC and Hibernate while trying to hide this fact and giving you a Rails-like API (personal opinion of mine). The problem with this is, once something goes beyond the trivial samples, it easily broke and didnt work for me. Developing with it was like walking on eggs (for me). Whenever I googled for documentation of a feature I needed, I was not redirected to samples, tutorials, blogs, but to the Grails JIRA explaining me why the feature wouldnt work for my use case and that the bug was unresolved since two versions before the one I was using.

While that may not be the overall experience for every developer (I am not writing this to bash Grails, but to give my experiences with it here), I needed something that helped me and would not stand in my way or break down on me when I needed it the most. Thats when I found Play and I have quickly migrated my app to it after I found out about it (around the ~1.0 release).

So far it has been a great ride and for the first time in my web development career, I have stopped looking at other frameworks trying to find something that I would like better.

If I had to close with one thing that Play did better than Grails - at least for me - it would be the fact the Play is built from the ground up with developer usability in mind. It does not sacrifice ease of use for enterprise buzzwords. It has the guts to throw away what does not fit into this paradigm (e.g. ditchting Servlet-based runtimes during development for faster turnaround). It is willing to make compromises in order to guarantee awesomeness. And that is something I have only seen in communities like Rails or Django before I found Play.

like image 149
Sakuraba Avatar answered Nov 17 '22 11:11

Sakuraba


I'd suggest Grails. It has a bigger community than the play framework does (~350 plugins covering pretty much every basic need). Also, grails is written almost completely in Java, it just lets you use Groovy for your domain specific implementation.

If you do run into a performance issue where the groovy pages that you've created are the bottleneck, you can always just switch to a Java implementation. Then you're in the same boat that you would have been with the Play framework all the time. You've optimized your development time by putting off the coding of things in Java till you know that you actually need to do it (which, in my experience is very rare).

I'm also not sure where you heard that you need to restart your server for each modification, but that's actually not true. Grails supports reloading of controllers/gsps/services/domain objects, etc without restarting your server.

The mixed stacktraces can get a little long, but tool vendors (like Intellij) have made some recent improvements that strip out all the stacktrace portions that you don't care about.

I've been using grails since the .5 days and have been very happy with the platform.

like image 24
Ted Naleid Avatar answered Nov 17 '22 10:11

Ted Naleid


Take note that the Play! framework now supports using Scala as of 1.1

like image 27
Jeffer Avatar answered Nov 17 '22 10:11

Jeffer