My very first grails app was a simple SMS gateway called CyaThen.com. It was mostly developed on Grails 0.1 and then later migrated to 0.2 beta before the go live in August 2006 . It’s proved very useful for SMSing workmates to remember their squash gear.

Anyways, I did a rebuild on the app with Grails 0.4.2 so I could deploy it to Glassfish, but it was pretty unchanged from it’s 0.1 Grails glory. I’ve recently been updating it to 0.5.6 and uncovered some Gems from the “good ol’ days”…

Don’t you remember when every GORM class need hibernate ids embedded…

Long id
Long version

Back then, men were men, and there was one and only one ApplicationDataSource and log4j.properties

Back in the old days, if you wanted to def a taglib, you wanted to let the world know with an @Property

@Property welcome = { attrs ->
...
}

All the standard taglibs have been banished to plugins now anyways. And who could forget the best friend of every Domain class was a nice hashCode()… and equals()… and toString()…

String toString() { "${this.class.name} :  $id" }

    boolean equals(other) {
        if(other?.is(this))return true
        if(!(other instanceof Account)) return false

        if(!id || !other?.id || id!=other?.id) return false

        return true
    }

    int hashCode() {
        int hashCode = 0
        hashCode = 29 * (hashCode + ( !id ? 0 : id ^ (id >>> 32) ) )
    }

Now I’ve just got to work at transforming my optionals to nullable constraints and I’ll be there…

And through all those releases my original PostgreSQL database has just kept on trucking without a line of SQL from my hands.

Props to Graham and the boys in how far they’ve come in 10 months. That’s right, 10 months (And for how forgiving they’ve been about preserving compatibility through all those releases). My 0.5.6 codebase will be significantly smaller and more meaningful for their efforts.