Refactr Contributions to Grails and Groovy
Thursday, November 29th, 2007I’ve still been working with Groovy Builders in my free time lately. With quite a bit of help from Andres Almiray to refactor my builder example to use Groovy’s FactoryBuilderSupport, ObjectGraphBuilder was contributed to Groovy core about a month ago. That’s pretty exciting news around here: Groovy 1.1 will contain ObjectGraphBuilder. Many thanks to Andres for making that a reality.
In addition, a couple weeks ago I contributed a related subclass to Grails: DomainBuilder. This does the same as ObjectGraphBuilder, but relates collections of objects following the convention used for Grails Domain classes, using ‘addTo’ methods. The plan is to commit it to subversion once Groovy 1.1 is out, so DomainBuilder will ship with Grails 1.0, which is also exciting.
I expect to use DomainBuilder quite a bit on most projects. At the very least, it will help me keep BootStrap data more readable and maintainable.
Update: DomainBuilder was committed to Grails Head this morning (December 6).


