Skip to content

Category Archives: Groovy

The Thoughtworks Rover Problem – Groovy Edition

I had some down time at work, and set about working on the Rover problem. There are three problems, I chose the middle one to start with. I wrote it in groovy and used the very groovy clibuilder M. Laforge recommended in his comment. I mavenized it to make it easier to share. You can [...]

Developing Grails Apps in Eclipse

This was a post I was planning on linking to; a colleague of mine was going to write a post about it, but he hasn’t yet and I’ve just spent an extra hour trying to get this to work and am frustrated- and so here is the post you’ve all been waiting for. There are [...]

Dirt Simple EXTJS Grid on Grails

At my current contract, I’ve been using the popular EXTJS javascript library. In order to get up to speed faster, I’ve started a small project to assist my learning. I thought about using a number of back ends to support my project, but decided on Grails after reading about the built-in JSON converters. Getting started [...]

Groovy Environment Scripting

Problem: You want to use groovy all the time, but ignorant (but paying) forces keep you writing verbose tedious Java code instead. Solution: Use groovy instead of shell scripts! In large Java development projects, developing in a local environment comes with a maddening list of pulling levers, pushing buttons, and spinning wheels. Many of these [...]

Grails Extended ManyToMany GORM Example

This is a variation on this article. Having never been a big fan of writing XML, I’ll gladly opt for the XML-less version. The first example online I found has some formatting issues and just seems a little hard to follow. My step by step example follows after the jump. Call it the “Grails extended [...]

GORM Relationships in the Grails Console

I’ve just started scratching the surface with Grails. A good starting point seems to be understanding GORM or Grails Object Relational Mapping, which is based on Hibernate3. In looking at the Grails tutorials online, you might be inclined to start using Grails via scaffolding and generating controllers and views. And this is fine, but another [...]

Grails Startup Pain

Grails is a composed of a stack I like, a combination of technologies I’ve enjoyed using over the last few years- Groovy, HSQLDB, Spring, Hibernate, etc. And the whole seems greater than the sum of its parts, so while I’m complaining about it today, I do so knowing that with future releases Grails could really [...]

Groovy CLIBuilder In Practice

Ok, it doesn’t get much easier than this to build a CLI: class ContentUpdaterMain { static void main(args) { def cli = new CliBuilder(usage: 'java -jar contentupdater.jar -su[dh] "update name"') cli.h(longOpt: 'help', 'usage information') cli.u(longOpt: 'update', 'update the provided table', args: 1) cli.s(longOpt: 'stage', 'stage the provided table', args: 1) cli.d(longOpt: 'debug', 'run the process [...]

Groovy Build Script Using AntBuilder Example

As with most things in the life of a Java developer, doing simple things are simple, more complex things though are often much more complicated. For self-described slow learners such as myself, complex tasks become exponentially slower. So it has been with my adoption of the Groovy programming language. Even with the book, it’s still [...]