Summary
A dynamic Web application framework based on the Groovy language, Grails incorporates the convention-over-configuration philosophy that made Rails popular, but also allows close integration with enterprise Java frameworks. Grails 1.0 was released this week.
Advertisement
The Grails project reached its 1.0 milestone this week. Based on the dynamic Groovy language, Grails provides many of the metaprogramming techniques that make Rails development so productive, but Grails applications run on the JVM and can very easily incorporate existing Java libraries and code as well. According to the project's documentation:
Grails brings to Java and Groovy developers the joys of convention-based rapid development while allowing them to leverage their existing knowledge and capitalize on the proven and performant APIs Java developers have been using for years.
New features in Grails 1.0 include:
GORM [Grails O/R Mapping] features ORM DSL for advanced Mappings
Support for easy to use Filters
Content Negotiation support
REST support
JNDI Support
The DSL provided in Grails' OR mapping allows customizations not only in terms of column and table names, or the ID generation strategy to be used, but also in what second-level cache to use, or, if needed, what Hibernate custom types to map to.
Grails' filters are similar to the interceptors supported in earlier Grails versions, but they are more suitable for expressing cross-cutting application concerns, such as authentication, according to the Grails documentation, which illustrates filters with an example:
Similar to Rails, Grails supports content negotiation via the Accept/Content-Type HTTP headers, a URL parameter, or a URI extension. Another new feature in Grails 1.0, and an example of how well Grails fits in a Java enterprise environment, is the ability to obtain data sources via JDNI.
Our first project will go into public beta early next month. The alpha version is currently deployed using jetty at Slicehost. We plan to use that configuration for beta, then switch to Glassfish for final production.
After many years developing in Java, the move to Ruby/Rails three years ago was a great experience. And now, after a few months with Groovy/Grails, I can say that I'm very happy with the switch.