View stunning SlideShares in full-screen with the new iOS app!Introducing SlideShare for AndroidExplore all your favorite topics in the SlideShare appGet the SlideShare app to Save for Later — even offline
View stunning SlideShares in full-screen with the new Android app!View stunning SlideShares in full-screen with the new iOS app!
Born and Raised in Perl
Tuesday, November 18, 2008 4
Agile Java Consultant
Tuesday, November 18, 2008 5
• The Joy of BDD, or, Re-writing Your Code in
Mocks and Asserts is Not Unit Testing
• Functional (Meta)?Programming Stunts for Ruby
and Groovy (and a Little Perl)
• 7 Actually Useful Things You Didn’t Know Static
Typing Could Do: An Introduction for the
Dynamic Language Enthusiast
• A Defense of Prototypes, or, Why Does Tom
Christiansen Hate Perl?
Tuesday, November 18, 2008 6
• Introduced to Groovy/Grails at Carol.com,
Active in Groovy Users of Minnesota
• Uses Grails as freelancer to quickly develop
• Regular on IRC: FreeNode #groovy, #grails
• Active on Groovy and Grails mailing lists
• Autobase and BackgroundThread plugin
Tuesday, November 18, 2008 7
All Web App
Tuesday, November 18, 2008 8
• Stunningly simple development.
• Succinct code using a superset of Java.
• Sane defaults, straightforward conﬁguration.
• Static typing as deemed useful by developer.
• Standard deployment approach.
• SpringSource backed and here to stay.
Tuesday, November 18, 2008 9
What Is Grails?
• Web application development framework/
environment leveraging Java and Groovy.
• Convention-based MVC development with
a set of powerful command-line tools.
• Powered by pre-conﬁgured and pre-
integrated Spring, Hibernate, SiteMesh, and
Tuesday, November 18, 2008 10
How Would You
Like Your Grails?
• Conceptually thin dynamic MVC framework
• Dynamic, succinct domain and controllers
• Run from source code check-out
• Mash-up with extensible plugin architecture
• Actually approachable best-of-breed Java stack
• Prepackaged Java environment and build system
• Builds a WAR to plug into existing deployments
• Hooks for existing Spring and Hibernate conﬁg
Tuesday, November 18, 2008 11
Your Very Eyes!
Tuesday, November 18, 2008 12
• Manages database state using a non-linear
collection of database change sets.
• Leverages existing Grails database
automation to minimize effort.
• Provides a Liquibase-based embedded DSL
for database migrations.
Tuesday, November 18, 2008 14
Tuesday, November 18, 2008 15
• Provides a Spring bean that will execute
arbitrary closures in the background.
• Handles some awkwardness around
Hibernate sessions, and provides thread
pooling and logging.
Tuesday, November 18, 2008 16
But What About
JRuby on Rails?
Tuesday, November 18, 2008 18
My JRuby on Rails
• Work history in Rails,
including last 5 months
on a JRuby on Rails
• Regular attendee,
and one-time presenter
at Ruby Users of
• Charlie “Headius”
Tuesday, November 18, 2008 19
JRuby on Rails?
• Although Java-in-Ruby is fairly slick, Ruby-in-Java is pretty
rough and best mediated via Groovy metaprogramming
• GORM is superior to ActiveRecord
• GSPs are superior to ActionView
• Spring is superior to nothing
• Optional static typing is superior to pure dynamic typing
• You can code Grails without grokking its source
• Nobody is ﬁred for choosing Java
Tuesday, November 18, 2008 20
The One Circumstance
I Would Still Use Rails
• Small CRUD-based app with its own DB
• No or very generous performance limits
• Owned by one or two developers
• Expected life cycle of less than a year
• Deployed system is without Java or is an
Apache web server with mod_passenger
and without mod_proxy or mod_jk
Tuesday, November 18, 2008 21
• Best approach: start with a roughly green-
ﬁeld proof-of-concept web application
• Use GRAG on SourceForge to generate a
database front-end to impress your boss
• Wrap an existing Java web application in
Grails and use web.xml (installed via “grails
install-templates”) to map urls to servlets
Tuesday, November 18, 2008 22
• Home Pages:
• Live Open Source Applications
Groovy & Grails Podcast
Tuesday, November 18, 2008 23
Want to know more?
• Robert is offering “Introduction to Groovy,
Grails, and AJAX” training in the Triangle on
December 15th through 18th. Additional
training courses will be offered next year.
• Subscribe to “Smokejumper Training”
Google Group for more information.
• On-demand training, technical leadership,
and mentoring services are also available.
Tuesday, November 18, 2008 25