InfoQ

Presentation

Recorded at:
Recorded at

Writing DSLs in Groovy

Presented by Scott Davis on Jun 29, 2009

Community
Architecture,
Java
Topics
Domain Specific Languages
Tags
QCon ,
JVM ,
Groovy ,
QCon London 2009
The next QCon is in London Mar 10-12, Join us!
Summary
In this presentation recorded at QCon London 2009, after a short introduction to DSLs, Scott Davis plays with the keyboard showing how to approach the creation of a DSL by typing working snippets of Groovy code that get executed in front of the audience.

Bio
Author of the book Groovy Recipes: Greasing the Wheels of Java, Scott has been involved in creating web sites in Grails since 2006. Scott teaches public and private classes on Groovy and Grails for start-ups and Fortune 100 companies. He is the co-founder of the Groovy/Grails Experience conference and ThirstyHead.com, a training company that specializes in Groovy and Grails training.

About the conference
QCon is a conference that is organized by the community, for the community.The result is a high quality conference experience where a tremendous amount of attention and investment has gone into having the best content on the most important topics presented by the leaders in our community. QCon is designed with the technical depth and enterprise focus of interest to technical team leads, architects, and project managers.
Should read "scripting with Groovy" by Hermann Schmidt Posted Jul 2, 2009 6:37 AM
Re: Should read by Scott Davis Posted Jul 22, 2009 3:37 PM
2.hours and 10.minutes by Hossam Karim Posted Jul 4, 2009 1:04 PM
great presentation by Gilad Manor Posted Jul 4, 2009 11:54 PM
The video seems to doesn't work anymore... by Dragan Stankovic Posted Jul 16, 2009 7:37 AM
Re: The video seems to doesn't work anymore... by Dragan Stankovic Posted Jul 16, 2009 7:40 AM
Re: The video seems to doesn't work anymore... by Floyd Marinescu Posted Jul 16, 2009 2:08 PM
grade by Gene De Lisa Posted Dec 18, 2009 7:41 AM
  1. Back to top

    Should read "scripting with Groovy"

    Jul 2, 2009 6:37 AM by Hermann Schmidt

    Most of the talk is about conventional scripting that has always been around in some form. A bunch of interesting Groovy tricks (for newbies) are presented. Calling a console script that understands a few commands a DSL is a bit over the top in my opinion.

    The last 10 minutes or so Scott quickly demonstrates how to extend the meta class of a closed (final) Java class (Integer) to do the ubiquitous "2.hours + 10.minutes" example. That's more like it.

  2. Back to top

    2.hours and 10.minutes

    Jul 4, 2009 1:04 PM by Hossam Karim


    class Movie(var title:String, var duration: Int) {
    override def toString = title + " runs for " + duration + " minutes"
    }

    implicit def units(i: Int) = new {
    def hours = i * 60
    def minutes = i
    def and(j: Int) = i + j
    }


    val starWars = new Movie("Star Wars", 2.hours and 30.minutes)

    println(starWars)

  3. Back to top

    great presentation

    Jul 4, 2009 11:54 PM by Gilad Manor

    it really made my fingures itch:)

  4. Back to top

    The video seems to doesn't work anymore...

    Jul 16, 2009 7:37 AM by Dragan Stankovic

    Does anyone have similar problem?

  5. Back to top

    Re: The video seems to doesn't work anymore...

    Jul 16, 2009 7:40 AM by Dragan Stankovic

    Now it works again (don't know what happened in the meantime)

  6. Back to top

    Re: The video seems to doesn't work anymore...

    Jul 16, 2009 2:08 PM by Floyd Marinescu

    We recently deployed a fix for some video problems we were having. Thanks Dragan.

  7. Back to top

    Re: Should read

    Jul 22, 2009 3:37 PM by Scott Davis

    Thanks for your comment, Hermann. This is admittedly a basic presentation - it doesn't assume previous knowledge of Groovy or DSLs. You clearly preferred the internal DSL over the external. That's cool. If I could've been guaranteed an audience with deep experience in both Groovy and DSLs, I could've spent the entire hour covering just that.

  8. Back to top

    grade

    Dec 18, 2009 7:41 AM by Gene De Lisa

    The presenter gets an A for his knowledge of the topic.

    The videographer was a bit clueless on the terminal screenshots when zooming in on the left side of directory listings. We were all wondering what the permissions were and not what he was talking about right?


    As a presenter he gets a D. The first half is mostly about him. Count how many times he uses the word "I".
    That is the problem with these conferences. The entire point is gratifying the ego of the presenter; the anti-pattern to Kathy Sierra's "you rock".

Educational Content

Brian Marick on 4 Challenges and 5 Guiding Values of Agile Software Development

Brian Marick takes us through a quick tour of the most important values and challenges to adopting Agile successfully (they aren't the typical challenges and values we hear in the community).

Are You a Software Architect?

The line between development and architecture is tricky. Does it exist at all? Is an ivory tower actually needed? There's a balance in the middle, but how do you move from developer to architect?

Agile – A Way of Life and Pragmatic Use of Authority

The word 'authority' sometimes produces an allergic response in hard-line agilists. Freedom and authority – both are bad if misused and both are good if used in right spirit for a noble cause.

Getting Started with Grails, Second Edition

"Getting Started with Grails" brings you up to speed on this modern web framework. Companies as varied as LinkedIn, Wired, and Taco Bell are all using Grails. Are you ready to get started as well?

Using ITIL V3 as a Foundation for SOA Governance

Those familiar with only ITIL V2 often scoff at the thought that ITIL could serve as a governance framework for SOA. With ITIL V3, the focus of the framework shifted towards service-orientation.

Adrian Colyer on AspectJ, tc Server and dm Server

SpringSource CTO Adrian Colyer discusses AspectJ, SpringSource's dm Server and tc Server products, OSGi and Scrum.

Adam Wiggins on Heroku

Heroku's Adam Wiggins talks about Rails, Background Jobs, Add-Ons, Ruby, and how Heroku manages to work around Ruby's inefficiencies using Erlang and other languages.

SOA as an Architectural Pattern: Best Practices in Software Architecture

For Grady Booch the foundation of a good architecture is patterns, SOA being just one of many patterns. In this Second Life presentation, Booch attempts to bring more clarity on what architecture is.