views:

402

answers:

7

I'm working on getting an Introduction to Groovy presentation ready for my local Java User's Group and I've pretty much got it together. What I'd like to see is what you all think I just have to cover.

Remember, this is an introductory presentation. Most of the people are experienced Java developers, but I'm pretty sure they have little to no Groovy knowledge. I won't poison the well by mentioning what I've already got down to cover as I want to see what the community has to offer.

What are the best things I can cover (in a 1 hour time frame) that will help me effectively communicate to these Java developers how useful Groovy could be to them?

thanks

p.s. I'll share my presentation here later for anyone interested.

as promised now that my presentation has been presented here it is

+7  A: 

I don't know anything about groovy so in a sense I've qualified to answer this...

I would want you to:

  • Tell me why I would want to use Scripting (in general) as opposed to Java-- what does it let me do quicker (as in development time), what does it make more readable. Give tantalising examples of ways I can use chunks of scripting in my mostly Java app. You want to make this relevant to Java devs moreso than tech-junkies.
  • With that out of the way, why Groovy? Why not Ruby, Python or whatever (which are all runnable on the JVM).
  • Don't show me syntax that Java can already do (if statements, loops etc) or if you do make it quick. It's as boring as hell to watch someone walk through language syntax 101 for 20min.
    • For syntax that has a comparible feature in Java maybe show them side by side quickly.
    • For syntax that is not in Java (closures etc) you can talk to them in a bit more detail.
  • Remember those examples from the first point. Show me one, fully working (or at least looking like it is).
  • At the end have question time. That is crazy important, and with that comes a burden on you to be a psuedo-guru :P.

I'm not sure about how the Java6 scripting support works but I'm fairly sure it can be made secure. I remember something about defining the API the script can use before it's run.

If this is the case then an example you could show would be some thick-client application (e.g. a music player) where users can write their own scripts with an API you provide them in Groovy which allows them to script their app in interesting and secure ways (e.g. creating custom columns in the playlist)

SCdF
+5  A: 

I'd go for:

  1. Closures
  2. Duck typing
  3. Builders (XML builder and slurper)
  4. GStrings
  5. Grails
Rich Lawrence
+2  A: 

Include an example of how making Java code more groovy takes away soooo much code. Wait for them to pick their jaws up off of the floor before continuing. Scott Davis has a simple example at the beginning of Groovy Recipes that takes 35 lines of Java or 3 lines of Groovy.

Ed.T
+1  A: 

You should definitely show them how to create a quick Grails application. Two domain classes that are related. Build a basic CRUD app. Explain that tables are being created behind the scenes using GORM(Hibernate). Then explain that you can create a war file and deploy it as you would any other Java war file. You can also add Grails/Groovy to an existing Java/JSP project so it doesn't require a huge commitment or paradigm change.

Groovy/Grails is simply Ruby/Rails for Java people. I'd cover the plugins for Netbeans/Eclipse too. Groovy/Grails are just now getting full support in the major IDE's.

Finally, if you can find a good diagram that shows how Grails is built on top of Spring, Hibernate, Quartz, Sitemesh and Groovy, I think people will understand that there is a treasure chest waiting to be unlocked.

I purposely wanted to avoid Grails, they'd already been presented a Grails talk, I wanted to do a strictly Groovy talk. Thanks for the input though.
codeLes
+1  A: 

I'd mention the following things in addition to what has already been stated:

  • GDK - extensions/additions to existing JDK classes
  • Interaction between Groovy and Java code (basically a non-issue)
  • Compiling Groovy code to Java .class files
  • XML parsing and mechanisms for accessing document content

One thing I like doing with Groovy is implementing an interface defined in Java as a map from method names to closures. It's a cool thing you can do with Groovy, but probably well beyond an introductory presentation though.

Anthony Cramp
A: 

[More of a comment than an answer] Les, Nicely done on the Groovy presentation. Going through it reminded me of a dozen features of Groovy that I forgot about. (I'm pretty good at Groovy, but it's so rich with features...) I'm going to use your presentation slides like flashcards until I learn it all. Thanks.

A: 

here is a recent presentation of groovy and grails that seems representative: http://jshingler.blogspot.com/2009/01/codemash-2009-groovy-and-grails.html

Ray Tayek