Posted by Jason Rudolph on 20th May 2008
InfoQ recently posted the video of my presentation on Grails from QCon San Francisco. If 50 slides in 50 minutes sounds a tad formulaic and tired to you, then you’re in luck. Instead, you’ll see 50 slides in about 5 minutes, followed immediately by 50 minutes of no-nonsense live coding goodness.

In what could perhaps be described as a series of 12 back-to-back lightning talks, you can see what it takes to go from a blank slate to a deployable Grails app including…
- defining domain classes,
- setting up relationships,
- hooking up a database,
- establishing constraints and validation error messages,
- enjoying sexy dynamic finders,
- applying custom URL mappings,
- working with tag libraries,
- encapsulating business logic in services,
- integrating with existing Java code,
- sending e-mail,
- finding and installing plugins, and
- locking down the app with secure authentication and authorization
There’s some good Q & A in there as well. Unfortunately not all of the questions came through on the audio, but in most cases you can pick up the context from the reply.
You’ll also hear me reference Charles Nutter’s JRuby talk a few times over the course of the presentation, and I recommend checking out that video as well.
Tags: Grails, Groovy, GSwG, Java, Ruby, Speaking | No Comments »
Posted by Jason Rudolph on 3rd April 2008
Andres Almiray interviewed me this week for the Groovy Zone. We cover a breadth of topics, including:
- Just how far Grails has come in the past two years
- Why the GORM DSL likely obviates previous mapping techniques
- Groovy as a gateway drug to more and better developer testing
- Why Grails testing infrastructure improvements deserve top billing in Grails 1.1
- Something called Rails
- New testing-related developments in the Groovy ecosystem
For all that and more, check out the interview at Groovy Zone, a new(ish) and hoppin’ community for Groovy and Grails news.

(Did I mention that we discuss testing?)
Many thanks to Andres and DZone for the interview.
Tags: Grails, Groovy, GSwG, Java, Rails, Ruby, Testing | 2 Comments »
Posted by Jason Rudolph on 20th December 2007
The Groovy community’s been busy rolling out a steady stream of holiday goodness for the Java developers of the world: Groovy 1.5 was just released, Grails 1.0 RC3 is out, and now the Prags are prepping two new Groovy books for early next year. And to top things off, the folks behind NFJS are hosting a three-day conference with Groovy and Grails experts from all over the world.

The inaugural 2G Experience will take place February 21-23 in Reston, VA, and the agenda is slam-packed! BDD with Andy Glover. DSLs with Venkat Subramaniam. Google Maps with Scott Davis. Metaprogramming with Jeff Brown. A can’t-miss JRuby/Groovy smackdown with Neal Ford. A Grails keynote with Graeme Rocher. The list goes on…
I’ll be presenting sessions on Going Further with Grails and Bending GORM: 5-minute Techniques for Enterprise Integration. And to close out the conference, Relevance’s Refactotum series will make its Groovy/Grails debut. I’m teaming up with Scott Davis and Venkat Subramaniam (and any stray Groovy/Grails devs that happen to wander nearby) to host this hands-on workshop helping attendees make their mark on the Groovy and Grails revolution.
Refactotum: Groovy/Grails (3-hour workshop)
Contributing to open source is great for your career. In a few short hours, you can learn, teach, promote your skills, and improve the quality of the community. In this unique workshop, we will show you how, by doing it. Using Grails as an example, we’ll show you how to:
- download the source code
- build and run tests
- use Cobertura and code review to find problem areas
- refactor some code
- create and submit a patch
Take this opportunity to begin contributing to Groovy, Grails, or any other open source project that interests you. Experts from the Groovy and Grails community will be on hand to help you get started.
So is Groovy really “the next generation” of the Java language? Come decide for yourself. As for me, I couldn’t agree more.
Tags: Grails, Groovy, Java, Testing | No Comments »
Posted by Jason Rudolph on 22nd July 2007
Having tackled the conventional approach to Grails domain models as well as an XML-based solution for hooking Grails up to a non-conforming schema, it’s time to consider another option.
Whether you’re disheartened by writing too much XML (and prefer annotations instead), or you’re looking for a domain model solution you can use both with Grails and without Grails, EJB3 entity beans will get your where you want to be. In “Advanced Domain Models in Grails”, we’ll see the exact steps needed to take your plain ol’ statically-typed EJBs, and equip them with the dynamic superpowers of Grails domain classes (all without adding a single line of code to those poor POJOs). Feel free to download the sample app and take it for a spin. (Be sure to have a look at the included README files for all the details.)
Don’t have any EJB3 entity beans to use with Grails yet? No problem. The Ant script included in the download (and first discussed in yesterday’s post) not only includes the ability to reverse engineer Hibernate mapping files from a database schema, but also to produce EJB3 entity beans based on the schema. Once again, you’ll likely want to tweak the output somewhat to get your classes looking just the way you want them, but compared to manually performing the DB-to-POJO mapping, this tool is incredibly handy. (Thanks again to Raffaele Castagno for providing this script.)
Knowing that Grails embraces convention over configuration, is there any room left for a fourth part to this series? (Hint: “Convention over configuration” != “Convention instead of configuration.”)
Tags: Grails, Groovy, Java | No Comments »
Posted by Jason Rudolph on 21st July 2007
We began Part 1 of this adventure with a greenfield application that chose to kindly comply with all the standard Grails conventions. Now it’s time to venture into the land of non-conformity.
We first looked at hooking Grails up to a non-standard schema over a year ago now, way back in the days of Grails 0.1. This clearly remains a topic of much interest, as that tutorial has held its ground week in and week out for 13 straight months as the most highly-trafficked post on this site. Grails has seen significant progress since then, so an updated example is certainly in order.
In “Advanced Domain Models in Grails”, I’ll demo the exact steps needed to gain all the dynamic persistence goodness that GORM has to offer, regardless of whether your schema plays nicely with the Grails conventions. With just a sprinkling of configuration - 5 minutes of effort or less - we’ll be up and running. In fact, you can download and try out the app now. (Be sure to have a look at the included README files for all the details.)
To make this process even easier, the download includes an Ant script developed by Raffaele Castagno for reverse engineering the schema to produce the initial Hibernate mapping files for you. The resulting HBM files will need a bit of tweaking (as you would expect, since the whole point of this exercise is that your schema doesn’t map cleanly to your domain classes), but compared to coding up the HBM files from scratch, this tool is incredibly handy.
Keep an eye out for Part 3, where we invite EJB3 entity beans to the party. Stay tuned.
Tags: Grails, Groovy, Java | 1 Comment »
Posted by Jason Rudolph on 20th July 2007
For any developer that’s ever touched JDBC (and it’s safe to assume that’s most Java devs, right?), GORM is one of the many Grails features that addresses a clear and prominent pain point in the Java space. Put simply, GORM is humane ORM. It means leaving the low-level database-related plumbing to the framework and instead investing your time in the business tier. After all, your app needs to solve a business problem, right? And it’s a pretty safe bet that your business analysts didn’t spend time listing out any requirements about managing DB connections, result sets, sessions, or DAO code. Nope. They’re focused on a much higher level, and we should be too.
If you’re fortunate enough to be developing a greenfield application, you can just follow the Grails conventions and come close to forgetting that there’s a database under the covers at all. GORM dynamically equips you with all the persistence methods you need to manage your domain, and yet you still have the ability to drop down to that lower level should the need arise.
NFJS is in RTP this weekend, and in “Advanced Domain Models in Grails”, I’ll be looking first at the functionality that GORM provides out-of-the-box and then exploring how you can mold GORM to take advantage of its benefits in a variety of environments. We’ll start by looking at a sample app that colors within the lines of the Grails conventions, and you can download and try out that app now. (Be sure to have a look at the included README files for all the details.)
Inside the app you’ll find working examples of various relationship types (including many-to-many, which people occasionally struggle with at first), constraints, and the always-cool dynamic finders. Check out the test cases in test/integration. Among other things, the test cases illustrate exactly how the entities relate to one another. (Want to know which side of a many-to-many relationship can perform a cascading save operation? Check out the tests.) To run the tests, just execute grails test-app from the command line.
Of course, there’s just no substitute for hands-on experimentation. To interact with the domain models yourself, simply navigate into the project directory and run grails console to get an interactive shell where you can
experiment with the domain objects first-hand. Or better yet, write additional tests of your own! If you get adventurous (and I hope you do), try out some of the many other possibilities available in GORM.
Be sure to watch for Part 2, where we begin our venture into the land of non-conformity. Stay tuned.
Tags: Grails, Groovy, Java | 2 Comments »
Posted by Jason Rudolph on 5th July 2007
In one fell swoop, the Groovy team and JetBrains have seemingly annihilated the biggest reason (and perhaps the only reason) not to use Groovy in your Java project. With today’s release of Groovy 1.1-beta-2, you can now use the groovyc compiler to jointly compile both your Groovy and Java classes. And here’s the kicker: it manages all the dependencies for you! Groovy class A extends Java class B which references Groovy class C? No problem.
Read the rest of this entry »
Tags: Groovy, Java | 1 Comment »
Posted by Jason Rudolph on 13th June 2007
InfoQ has just published my review of the must-read book, Groovy in Action. If you're doing anything with Groovy, or even considering it, you really owe it to yourself to pick up a copy of this book. If you haven't had a chance yet to check out Groovy in Action, the review should give you a good idea of what to expect from the book, and Manning has also thrown in two chapter excerpts from the book (including one on the incredibly handy Groovy JDK) to give you a feel for it first-hand.
If you notice that the review reads a bit differently than what you might typically expect, that's due to InfoQ's unique requirements for its reviews. InfoQ reviews aim to "contain less metadata and more data, or said differently, less talk about the book and more talk of the content in the book." The hope is that the reader learns something even while reading the review. It seems like a cool idea to me. So, what do you think? Let us know in the comments over on InfoQ or below.
Tags: Book, Grails, Groovy, Java | 1 Comment »
Posted by Jason Rudolph on 13th May 2007
Well folks, the tenth and final installment is upon us. Just three more sessions make up our home stretch…
The Scala Experience — Safe Programming Can Be Fun!
Presented by Martin Odersky (Professor in the School of Computer and Communication Sciences at EPFL)
The Java Posse has been chatting up Scala for some time now, so what better way to see what all the fuss is about than to get the scoop on Scala straight from its designer?
Read the rest of this entry »
Tags: Java, Ruby, Scala | No Comments »