RESTing easy with Grails

Representational state transfer (REST) is a way of thinking, not a protocol or standard-- it's a style of designing loosely coupled applications that rely on named resources (in the form of URLs, URIs and URNs, for instance) rather than messages. Ingeniously, REST piggybacks on the already validated and successful infrastructure of the Web-- HTTP. That is, REST leverages aspects of the HTTP protocol such as GET and POST requests, which map quite nicely to standard business-application needs such as create read, update, and delete (CRUD). By associating requests, which act like verbs, with resources, which act like nouns, you end up with a logical expression of behavior: GET this document and DELETE that record, for example.

To quote Leonardo da Vinci, "simplicity is the ultimate sophistication." REST embodies this thought and thus yields highly scalable, loosely coupled systems that, as it turns out, are simple to build. There are a few mechanisms for implementing RESTful applications-- Restlets and JSR 311 are two in a handful of options; however, they address one aspect of RESTful applications and ignore other aspects like an ORM and testing. Groovy's Grails gives you the ability to apply RESTful techniques with a full fledged web application framework that supports an ORM and testing to boot! As you see, using Groovy's Grails framework makes building RESTful Web services a snap.


About Andrew Glover

Andrew Glover

Andrew is the founder of the easyb BDD framework and the co-author of Addison Wesley's "Continuous Integration", Manning's "Groovy in Action" and "Java Testing Patterns". He is an author for multiple online publications including IBM's developerWorks and Oreilly's ONJava and ONLamp portals. He actively blogs about software at thediscoblog.com.

More About Andrew »