InfoQ

News

Grails 0.6 Adds Best of Breed Mix From Spring Web Flow and Rich Conversations a la JBoss

Posted by Shane Witbeck on Sep 14, 2007

Community
Java
Topics
Web Frameworks
Tags
Grails
Graeme Rocher announced that Grails is moving further away from "its Rails-like beginnings" with this latest release.  Although this release was labeled as 0.6, it's clearly being modest with the amount of work that went into it. Here's the full feature list:

  • Joint Groovy/Java Compilation
  • Spring Web Flow Integration
  • Support for Spring scopes to allow scoped services
  • Improved support for REST with automatic XML/JSON marshalling and RESTful URL mappings
  • New Config DSL for configuration not possible by convention
  • Refreshed scaffolding interface and branding
  • Support for Sitemesh inline decorators
  • Controllers can now call tag libraries as methods
  • New GSP tags
  • Massive improvements to speed of start-up time, unit tests and generation tool

Spring Web Flow Integration

Just as Rod Johnson had proposed a new way of defining Spring-managed beans via code rather than the traditional XML markup, Graeme takes a similar approach by defining Spring Web Flow definitions with Groovy:

showCart {
on("checkout").to "enterPersonalDetails"
on("continueShopping").to "showCatalogue"
}
enterPersonalDetails {
on("submit") {
def p = new Person(params)
flow.person = p
def e = yes()
if(p.hasErrors() || !p.validate())return error()
}.to "enterShipping"
on("return").to "showCart"
on(Exception).to "handleError"
}
enterShipping {
on("back").to "enterPersonalDetails"
on("submit") {
def a = new Address(params)
flow.address = a
if(a.hasErrors() || !a.validate()) return error()
}.to "enterPayment"
}

The above snippet illustrates the concept of defining a unit of work or "conversation", as described in the JBoss Seam framework. Just as in Seam, the "flow" contains conversational state information.

Automatic XML/JSON marshalling and RESTful URL mapping

While previously using a plug-in for conversions, this release uses:

 import grails.converters.*
...

def list = {
render Book.list() as XML
// or render Book.list() as JSON
}
Seam by Martin Gilday Posted Sep 15, 2007 8:15 PM
Re: Seam [News Item Updated] by Scott Delap Posted Sep 16, 2007 12:11 PM
nice work by serge boulay Posted Sep 16, 2007 1:36 PM
  1. Back to top

    Seam

    Sep 15, 2007 8:15 PM by Martin Gilday

    What integration has been added with JBoss Seam? There is no mention of it in the release notes. Here you have a subtitle "Rich Conversion via JBoss Seam" but then only have a code snippet showing content rendering, of XML and JSON. Graeme's blog seems to suggest that Grails' new integration with SWF provides something equivalent to Seam's conversations, not "via". Sorry to be pedantic, but the title just seems misleading (unless I have misunderstood).

  2. Back to top

    Re: Seam [News Item Updated]

    Sep 16, 2007 12:11 PM by Scott Delap

    Martin,

    You are correct. The news item has been updated to correctly identify that the conversation features are similar to Seam but not implemented using seem. Thank you for the quick observation.

  3. Back to top

    nice work

    Sep 16, 2007 1:36 PM by serge boulay

    exciting stuff guys, keep up the great work!!

Educational Content

Brian Marick on 4 Challenges and 5 Guiding Values of Agile Software Development

Brian Marick takes us through a quick tour of the most important values and challenges to adopting Agile successfully (they aren't the typical challenges and values we hear in the community).

Are You a Software Architect?

The line between development and architecture is tricky. Does it exist at all? Is an ivory tower actually needed? There's a balance in the middle, but how do you move from developer to architect?

Agile – A Way of Life and Pragmatic Use of Authority

The word 'authority' sometimes produces an allergic response in hard-line agilists. Freedom and authority – both are bad if misused and both are good if used in right spirit for a noble cause.

Getting Started with Grails, Second Edition

"Getting Started with Grails" brings you up to speed on this modern web framework. Companies as varied as LinkedIn, Wired, and Taco Bell are all using Grails. Are you ready to get started as well?

Using ITIL V3 as a Foundation for SOA Governance

Those familiar with only ITIL V2 often scoff at the thought that ITIL could serve as a governance framework for SOA. With ITIL V3, the focus of the framework shifted towards service-orientation.

Adrian Colyer on AspectJ, tc Server and dm Server

SpringSource CTO Adrian Colyer discusses AspectJ, SpringSource's dm Server and tc Server products, OSGi and Scrum.

Adam Wiggins on Heroku

Heroku's Adam Wiggins talks about Rails, Background Jobs, Add-Ons, Ruby, and how Heroku manages to work around Ruby's inefficiencies using Erlang and other languages.

SOA as an Architectural Pattern: Best Practices in Software Architecture

For Grady Booch the foundation of a good architecture is patterns, SOA being just one of many patterns. In this Second Life presentation, Booch attempts to bring more clarity on what architecture is.