You can certainly replace XML or JavaConfig with Groovy. In fact, that's what the Groovy configuration stuff from Grails does. I've also seen other similar efforts to configure Spring in other languages, including one awhile back called Springy that let you configure it in Ruby.
I don't cover those in the book, though. Even so, they're great configuration options to consider. I especially like the Groovy configuration stuff. Configuring in
Java or Groovy (or any other language) rather than XML buys you a lot of benefits, including less of a dependence on
string identifiers, more type safety, testability of the configuration themselves, and the ability to write intelligent configuration (configuration that takes advantage of language constructs to do more than just simply create objects and set properties...make decisions, loop, etc).