englishteeth.co.uk

… the weblog of Ian “English Teeth” Robinson
  • rss
  • Home

Groovy on Grails

April 15, 2008 | 8:37 pm

I’ve been having a dabble with Groovy on Grails and on the whole I’m liking it.

It took me less than 10 minutes from initiating a download to getting a basic but functional CRUD application up and running. This is understandably quite satisfying, but it also raises some concerns.

The prototype I threw together consisted of 4 domain objects. Grails took care of the scaffolding; creating controllers and the appropriate views for each of these. The bundled jetty server meant a painless grails run-app later and I could see the fruits of my (absence of) labour.

Following this, the next thing I looked to was the service layer. Actually, I jumped straight to a web service since all I needed to do to expose one of the domain objects was to install the xfire plug-in (grails install-plugin xfire-plugin.zip) and the following class:

class ActivityService {
    static expose=['xfire']
    Activity[] getActivities() {
        Activity.list() as Activity[]
    }
}

Pretty neat… Well, except that I now have a domain object constituting part of a web service contract.

Obviously my test application was just that, as test of what grails was all about, not a project exercise, but without even thinking contract first web services went out of the window.

Maybe I’m growing too cynical or conservative, but I can’t help feel that if you make things so easy to do that you hardly need to think about them it makes it easier for bad practices to slip in.

Perhaps if I’d followed my own principals and written a test for what I wanted to do first, which grails seems to provide very good support for, it would not have happened.

Yeah, I think I’ll choose to think that.

Categories
development
Tags
agile, contract first, grails, groovy, tdd
Comments rss
Comments rss
Trackback
Trackback

« This week I have mostly been reading… Web Service Read timed out »

One response

[...] then added the service (much like the xfire one)

englishteeth.co.uk » Grails, JMS and an MDB | April 18, 2008 | 1:09 pm

[...] then added the service (much like the xfire one) to receive messages (the message driven [...]

Leave a comment

You can use these tags : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Author

Ian Robinson is a relatively agile software engineer interested in things both sides of the object relational divide and beyond.

Categories

  • development (35)
  • miscellaneous (20)
  • music (7)
  • software (13)

Blogroll

  • Dan North
  • Dave Astels
  • Dave Wood
  • eirikso.com
  • Matt Raible
  • Object Mentor Blog
  • The Ancient Art of Programming
  • The Wisdom of Ganesh

Tags

active-mq architecture bauhaus blu-ray css db eclipse esb festivals freesat gorm grails groovy hd hd-dvd hibernate java jboss jms junit links mce media center mini music oracle osgi patterns pirsig plugins satellite soa software spring sql struts2 testing themes tools tv web wordpress xml xpath xslt
rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox