Grails gets selected for our 2008 project !

Funny thing that Grails went from being the red-headed step child to favored son here at work, in a very short couple of months.

Came about because we had a few days to do R&D in November, and with that little amount of time I couldn't risk a failed project. So I wrote a quickie persistence app for our Flex prototype in Grails, even though I had never done a Grails project in my life.

Grails performed so well as a prototyping platform that it passed the ultimate test - it disappeared, in management eyes. "Whatever you did, it obviously worked." kind of stuff, so now they want us to repeat what we did on the real thing, not just the prototype. It's a good thing, because we have a huge amount of work to do this year, and there are only two of us to do it. With Grails, we have a chance of getting it all done.

But it's not just Grails, its the fantastically growing Grails ecosystem. Plugins seem to be appearing daily, and this weekend I was going over my grails discussion list emails and found an announcement that the Grails Flex Plugin has been announced ! Yeah ! Flex is already our chosen UI, and we had already bolted up to it with Grails pretty easily, so making that one step easier is even better !

Getting My Grails Chops Up To Speed:

I can confirm from experience that if you aren't a grails programmer, you can still get a lot of stuff done quickly by looking up every move in the documentation before you make it. I got an entire app built that way quickly, and it wasn't bad at all.

But I need to step up to the next couple of levels with my Grails skills, including training others here on how to do everything. So I am setting up a 21 day program, knowing that if I can do anything for 21 days it will burn in nice and solid. If you see anything else I am missing or should add, please feel free to comment below.

The main categories are

  • Setup and project organization.
    • Eclipse setup and integration
    • Maven integration
    • OC4J deployment
  • Testing habits and skills
  • Groovy syntax and semantics
  • Gant syntax and semantics

Extra benefits Three Boxes: One of the nicest things about my current setup is I am spread across three boxes right now so doing everything three times will probably help me solidify things. Especially with setups, sometimes I do stuff experimentally and then can't even remember what it was that I did that worked, since sometimes it takes dozens of experiments to come up with the one that did.

My 21 Day List: A One Hour Regimen

Credits: Before I get started, much of this is directly inspired by the grails test cases found directly in the grails source tree
Pre-requirements: If you were repeating this yourself, the list assumes you are a standard everyday java programmer, coding in Eclipse every day for years, following relatively standard java coding conventions as would be found on any conventional open source project. You would also be a habitual maven user. I use myEclipse here, but that wouldn't be necessary.

This is my actual list, it shouldn't take more than an hour a day once I learn it all.

  • new grails workspace in eclipse
  • new grails snapshot installation from the grails site
  • new groovy installation from the groovy site
  • $groovy -version
  • $grails -version
  • get eclipse all set up and working in the new workspace
    • funky doodle groovy idiosyncracies
    • funky doodle grails idiosyncracies
    • some kind of bizarre integration with my maven projects
  • from cygwin shell
    • build new grails application
    • add new domain classs
    • generate controllers and views for same
  • from groovy test packages
  • everything above
  • deployment tests
    • deploy to jetty using shell
    • deploy to tomcat inside myEclipse
    • deploy to OC4J on localhost
    • deploy to OC4J on dev box
    • deploy to my account
  • canoo web test
    • create canoo web test
    • run web test against localhost deployment
  • database tests
    • deploy to hsql with create new every time
    • deploy to myslql
    • deploy to oracle with update off
    • deploy to derby with create new every time
  • initialize data structures
    • test creation of ....Bootstrap.groovy files
  • check logging
  • groovy
    • make sure I know how they use the builders to do things like write log4j xmls
    • identify syntax and semantics I am not familiar with and add each to this list
  • maven
    • try and get it building as maven build ?
    • still trying to get my head around this one
  • gant
    • at least one or two gant scripts written and executed daily
  • misc tests to run as my daily build
    • go through grails tests in the source and peel out a dozen or so examples that apply and repeat in my own
  • would be cool but not for this exercise
    • continuous integration
    • drools plugin
    • dsls

But Wait, There's More !

"...but wait ! There's more !" is actually a quote from the movie Jungle Book. Baloo the bear is being given a eulogy because they think he's dead, but really he's listening to the eulogy. When they finish he wakes up and begs them to keep saying nice things about him.

The list of daily activities above needs to exand to be specific about a bunch more tests, especially ones that involve grails specific usages or even groovy specific semantics and syntax.

There is so much there that I will need to enumerate in future blogs. Otherwise I won't ever get this one published.

The Ultimate Test: A Screen Cast

What if I really followed through on this threat, and dedicated February 2008 to getting through this 21 day burn in ? It would probably make me a pretty good beginner in Grails, enough to try making a screen cast demonstrating Grails great capabilities.

So maybe I'll do that. It would be a nice test. February 28 would be a nice day to publish it.

Other Follow Up

This is an update from May 2, 2008

Just got an announcement from one of our local user's groups (Plano Java) about a Grails presentation, this is what is being presented, and it makes a great checklist for above.

Is Groovy the next Java? Is Spring the next J2EE? Is GORM the next
JDBC? Is GSP the next JSP? Is Spring MVC the next Struts? Is XHTML,
CSS, JavaScript and Ajax the next preferred Rich UI for Business
Applications? Is Grails an alternative for creating another MS Access
Data Entry / Report App? Is making a working web application quickly
allow for code maintenance? Is convention over configuration
confusing? Can a REST "GET" web service be done easily? Is HSQLDB a
suitable test database? This presentation will demonstrate getting a
Grails application up and running.

The following concepts will be touched upon:

   * Create a web app using Grails
   * Install a plugin (Ivy)
   * Create Domain Class
   * Create CRUD web pages for the Domain Class
   * Create initial data for "development" environment (using
   * How to change the port number that the web app runs upon
   * How to get a war file of your Gails app
   * Providing a "Get" REST Web Service URL
         o Provide REST Web Service results data in XML, JSON or HTML
   * Modify the default Layout of web pages using Sitemesh
   * Adding YUI CSS
   * Adding YUI Widget(s)
         o Add a Horizontal JavaScript Powered Menu using YUI
   * Adding Custom CSS
   * Creating basic login and logout functionality
         o Use a filter to ensure that secure pages (actions) are
only available to logged in users
   * Create Page Controllers
   * Creating GSP pages and use GSP Tags
   * Running Tests
   * Adding a Service
   * Injecting a Controller with a Service
   * Logging using the default log property
   * Adding a file upload form
   * Ajax
         o Add Ajax (YUI) to the upload form
   * Upgrade the Project to a New Version of Grails
   * Export the database schema to a file for inspection

   * Use Eclipse IDE for editing