I agree with Jason that Play might be better than Grails. With four Grails projects under my belt (ahead of two Tapestry projects and one Wicket project), I seriously watch Play Play.
One of the things that I thought was cool about Grails was that "all Groovy." That is, you use Groovy to write everything (except HTML and CSS) - domains, controllers, services, page templates (GSP), tag libraries, Hibernate API (GORM), unit tests (GUnit) and build scripts (GANT). You can even write shell scripts in Groovy. Thus, the ability to encode all aspects of an application using one language again seemed to be a simplification that has long been called - back to the days of writing desktop applications in one language, such as C ++ or Delphi. However, I found out that one size does not fit all.
First, the IDE support for Groovy is small. IntelliJ does a better job, but with Groovy is dynamic, it can go that far. Refactoring tools cannot (cannot) catch everything, so you cannot trust them 100%. This means that you must be especially vigilant in unit testing. Here again, because Grails relies so much on the dynamic “magic” that happens at runtime, unit testing at Grails needs to rely on an extensive mocking layer to emulate it, and this mocking layer is quirky. The third problem is that most of the so-called Groovy code that you write is actually domain code (DSL). (In short, DSLs are Groovy shortcuts, using the fact that Groovy and a lot of syntax are optional.) Grails uses different DSLs for different configurations, URL mappings, etc. And this is inconsistent. For example, as you specify the log4j options, nothing looks like the way you specify data sources, and none of them look like the pure Java Groovy is based on. Thus, the promise of "all Groovy" still falls.
In this case, I see where the Play team comes from.
Reverting to plain Java for domains, controllers, services, and JUnits makes sense. Strong typing means that the IDE can reliably help with intelligence, code navigation, refactoring, etc. (And so you don’t have to pay for IntelliJ if you are happy with Eclipse.) You need to write more detailed code to get strong support for the tool, it seems to be very good for me now. We'll see.
I like that I still use Groovy in page templates. I'm afraid that in the end I can add more code to the templates than I should.
I have no experience with JPA, but it looks like it's pretty close to what GORM does for me, so cool.
Spring IOC support in Grails is completely transparent, while Play support seems minimal; however, I believe that IOC is too abusive, and I am perfectly prepared to pass Spring XML code in the rare case that I really need. (One of my open questions is that I assume JPA supports the transaction, so Play doesn't need Spring for what Grails does, no?)
I've never been a fan of Python, so I cringed when I read that Play uses Python for its build scripts. But I agree that Grails GANT scripts are pretty slow. Plus, I find that while GANT is a huge improvement over XML ANT, it's still hard to wrap your head around ANT concepts. Grails GANT scripts are pretty confusing. So, I will go to him with an open mind.
The Play "application module" model sounds just like the Grails plugin model, so cool.
I am very impressed with the Play documentation that I have read so far. I had a huge number of questions, but half of them were answered right away.
I will talk about myself again later when I dive deeper.
Craig Jones Oct 30 '09 at 10:51 2009-10-30 10:51
source share