Groovy and Grails
I had the pleasure of attending a free Groovy and Grails seminar hosted at SkillsMatter in London by Dierk König and Graeme Rocher.
Having used Groovy already for some months but not having had time to extensively learn its full feature set, I found out some interesting things I hadn’t noticed / remembered. This includes ranges and using exotic objects as “case” conditions in switch statements. No more the horrendous “if…then…else if…” chain.
As for Grails, it was great to be able to interrogate one of the main protagonists (Graeme). I’ve only been playing with grails for a couple of weeks but it shows huge promise, and Graeme and the grails user mailing list members have been most helpful.
I’m looking forward to trying out the Ajax stuff and also doing some exploratory work on strapping WebMacro views onto it to replace the GSP (Groovy Server Page) view which in my opinion is just as bad as JSP in that it allows all manner of scripting sins within the view – but nicer than JSP in that you can expand values anywhere in your document without resorting to a tag.
Of interest was the realisation that “grails console” exists as a command and allows you to perform quick tests and examinations of your domain model. Also Graeme told me how to include template content in views across controllers (<g:render template=”/common-template-path.gsp”/>). As I’m not yet a SiteMesh convert (reparsing the response and requiring full render before delivery starts?!) I like to do headers and footers etc the “old” way.
I’ll also be interested to see how the WebTest integration will handle functional testing of Ajax driven sites.
Dierk and Graeme are running some Grails training courses at SkillsMatter later this year, I strongly recommend them for anybody who wants to get a foothold on this exciting and fun new area of programming for us tired Java hacks!
No related posts.
Hi Mark,
Thanks for the great comments and for attending the seminar. With regards to sitemesh, the performance hit is actually (amazingly) minimal, hence it’s popularity. It does some special tricks, it actually wraps the “real” response object in a sitemesh one that uses a StringBuffer instead of writing directly to the response.
So in terms of the developer they “think” they’re wriitng to the response, but you’re actually just building up a string which sitemesh then includes into the real response later.
PS We’ll have to agree to disagree on GSP