Category Archives: Groovy

Using Groovy AST to Add Common Properties to Grails Domain Classes

Groovy offers a lot of runtime meta-programming capabilities that allow you to add reusable functionality in a shared fashion. Grails plugins make use of this ability to enhance your project. One of the things that you can’t do with runtime … Continue reading

Posted in Code, Groovy | Tagged , , | 4 Comments

Announcing Grails Constraints Custom Domain Constraint Plugin

I’ve released my first public Grails Plugin today. The Grails Constraint plugin gives you the ability to create custom Constraints that you can apply to your Domain classes to validate them. These are applied and act just like the built … Continue reading

Posted in Code, Groovy | Tagged , , | 6 Comments

DRYing Grails Criteria Queries

When you’re writing code, Don’t Repeat Yourself. Now say that 5 times. *rimshot* One of the things that I find myself repeating a lot of in many business apps is queries. It’s common to have a rule or filter that … Continue reading

Posted in Code, Groovy, Web | Tagged , , , | 12 Comments

Grails Embedded Classes ClassCastException

Using ORM tools allow you to map the data to a database independently of how your object model looks. Grails supports one-to-many and one-to-one relationships if you want to have the data in different table. But what about when you … Continue reading

Posted in Code, Groovy | Tagged , , | 6 Comments

Update Table Data in Grails using Ajax Calls

Using Ajax for simple forms can offer users a very clean, simple and fast way to input data. I came across a situation recently where I was looking into replacing a document based workflow with an application. The documents themselves … Continue reading

Posted in Code, Groovy | Tagged , , | 5 Comments

Grails Testing Acegi Security

Almost every web application I create needs some form of user authentication and authorization. Grails provides a great plugin system that allows you to extend the base framework to provide these kinds of features. My current favorite security plugin for … Continue reading

Posted in Groovy | Tagged , , , , | 6 Comments

Grails Validations Based on Related Objects

Grails has a rich set of tools for performing validations of your domain objects. There are quite a few built in validations that you can use. These mainly resolve around validating single properties within a single domain object. It also … Continue reading

Posted in Groovy | Tagged , | Leave a comment

Package Grails DBMigrations in your WAR File

The Grails DBMigrate Plugin is a handy way to give you control over the generation of your database if you don’t want Grails to auto-munge your schema. It works fine in development, but when you create a WAR for deployment … Continue reading

Posted in Groovy | Tagged , | 4 Comments

Grails Philosophy

There was a post on the Grails Mailing list today asking about the philosophy of Grails. This is my response: I think I might have ripped this off from somewhere, but fundamentally there are 4 questions to answer for a … Continue reading

Posted in Code, Groovy | Tagged | 3 Comments

CruiseControl With a Specific Version of Grails

Continuous Integration is a good practice in software development. It helps catch problems early to prevent them from becoming bigger problems later. It helps to reinforce other practices like frequent checkins and unit testing as well. I’m using CruiseControl (CC) … Continue reading

Posted in Automation, Code, Groovy, Web | Tagged , , | Leave a comment