Groovy demo 1021 - Pause[x]London 2011

5 downloads 149 Views 2MB Size Report
Oct 21, 2011 ... www.groovyexamples.org. ® books from Manning.com. ▫ Groovy in action. ▫ Making Java Groovy. ® Pragmatic programmers. ▫ Groovy Recipes.
  21

October 2011   Starting with Groovy   John

Renfrew – Right Way Up/ att.it{ude}

  skype

rwu2359

  accessed

by ScriptMaster plugin from 360Works   agile, dynamic language for Java platform   dynamically and statically typed   Java

is compiled == fast, but restricted   Groovy is interpreted, and compile at runtime   open

source, community developed

  more

  is

agile and faster development than Java

a ‘superset’ of Java (Java++)   but also contains things that Java doesn’t   and reduced typing, easier to read, simplified methods

  groovy.codehaus.org   stackoverflow.com   mrhaki.blogspot.com   kousenit.wordpress.com/category/groovy/   www.groovyexamples.org   books

from Manning.com

  Groovy

in action   Making Java Groovy   Pragmatic   Groovy

programmers

Recipes   Programming Groovy

  Everything

is an object   Every object belongs to a class   surname,

  Objects   what

type of thing

have methods

you can do with that class of object   find out about syntax rules from API   can take parameters

  Create

a script and walk through it   Some similar constructions that are instantly recogniseable   But reverse order   FM

DoThis( to that; and more)   Groovy that.doThis()   chaining that.doThis().doMore().thenDoThis()   Comments   //ignored

line   /* ignored block lines */

  IS

CASE SENSITIVE!!!!!!!!!   AND STRICT   unlike

FM which will not let you create dodgy script syntax, you can write complete nonsense here

  Reserved

keywords, can’t call an object the name of a method, and more   Groovy implicitly ‘returns’ something but for use in ScriptMaster you need to explicitly Return   If it fails you get error information, but you need to learn how to read that   Let’s

go…

  Why?   It

allows us to use ANYTHING that is written already for Java inside FM   Expando

– Todd Geist, persistant variables   Google calendar, Freshbooks   XML processing   FTP   PDF, my session yesterday   Image thumbnails   Zip files   Printing   Base32, UUID, Passwords, Growl, HTML creation   And

YOU get to write it