Journal Articles
Browse in : |
All
> Journals
> CVu
> 281
(11)
All > Topics > Programming (877) Any of these categories - All of these categories |
Note: when you create a new publication type, the articles module will automatically use the templates user-display-[publicationtype].xt and user-summary-[publicationtype].xt. If those templates do not exist when you try to preview or display a new article, you'll get this warning :-) Please place your own templates in themes/yourtheme/modules/articles . The templates will get the extension .xt there.
Title: Groovy and Grails eXchange 2015
Author: Martin Moene
Date: 09 March 2016 14:40:36 +00:00 or Wed, 09 March 2016 14:40:36 +00:00
Summary: Ralph McArdell reports on his conference experiences.
Body:
A week or two before Christmas 2015 I attended the 2015 Groovy and Grails eXchange conference thanks to the generosity of one of the speakers, ACCU member and occasional speaker at ACCU London meetings, Schalk Cronjé, who donated his complimentary conference ticket to me. The conference [1] was held over two days at the Skills Matter CodeNode building in central London on Monday and Tuesday the 14th and 15th of December 2015.
As I knew very little of Groovy and less of Grails my focus was on finding out a bit about Groovy, Grails and related topics. I did find out a quite bit but of course still have a long way to go so please accept my apologies for any errors and mistakes I may have made in what follows.
Monday
The conference registration opened a bit early at 08:00 so the keynote, titled ‘Call me Apache Groovy’ and given by Cédric Champeau, could commence at 09:00. The keynote was a mostly non-technical look at the history of Groovy and the community around it from its inception in 2003/2004 by James Strachan up to the ‘present’ of 2015 when Groovy became an Apache hosted project – hence ‘Apache Groovy’ – and one Russell Winder, a name some may recognize, is listed as a project committer. The talk ended with some speculation for Groovy in 2016 and beyond.
Following a quick break I went to a talk on SDKMAN [2] given by its creator Marco Vermeulen. SDKMAN was previously known as GVM (Groovy enVironment Manager) and manages Groovy installations, a task complicated by the combinations of available versions of Java related software development kits (SDKs). It seems SDKMAN can manage parallel installations of primarily Java related SDKs, has a command line interface and uses tools such as Bash, curl and unzip and PowerShell on Windows. SDKs are made available on the SDKMAN server by ‘vendors’ and once an SDK release is published on the server it is available to the SDKMAN client to download and install.
The second session of the morning I attended was given by Schalk who talked about idiomatic Gradle and recipes for Gradle plugin authors. I learned that there are over 600 Gradle plugins in the repository. Schalk noted that some are not that well written and proceeded to present a set of points to consider, and preferably follow, when writing plugins for Gradle.
I rounded off the morning with a talk given by Tony Davidson and Fergal Dearle on AST (Abstract Syntax Tree) transforms which used the building of a simple game engine DSL (Domain Specific Language) for kids as an example. They noted that even Hello World is not easy when trying to teach kids Java and how much easier children found Groovy – so much so they thought of the game engine DSL as a way to take the children further. I learned that Groovy supports AST transforms allowing modification of a Groovy compilation AST.
The first session I attended after lunch was on Groovy DevOps in the cloud given by Andrey Adamovich. Andrey noted that automating the provisioning of containers and servers is needed but doing so with Java is difficult. He then went on to describe various server provisioning automation scenarios involving, variously, ant, Gradle, Puppet and the like and ending up with a plethora of tools he has written using Groovy to automate such tasks including Gramazon [3] for controlling Amazon EC2 resources, sshoogr [4] for working with remote servers via SSH and p-unit [5] for verifying the results of provisioning scripts used with the likes of Puppet et al. He concluded that Groovy with Gradle makes the ultimate automation glue.
Thinking that it is always good to know how people go about testing the second talk of the afternoon I went to was given by Jeff Brown on testing in Grails 3. It turns out Grails 3 testing is performed using some Grails specific extensions to the Spock framework [6]. Being outside the community Spock was new to me but the examples that were presented looked to be quite elegant.
The final session of the day was a ‘Park Bench Discussion’ in which a bunch of the speakers sat up front and answered questions from the floor. Following the discussion there was a ‘party’ involving pizza and some free beer.
Tuesday
The second and final day of the conference started later than the first at 10:00 with a keynote given by Graeme Rocher on Grails 3.1 and the road ahead. Graeme started by running through the state of current Grails releases: that the 2.x series is in maintenance mode, version 3.0.10 was the then latest release and Grails plugins continue to be ported to the new 3.x architecture. Next came a recap of some salient points of Grails 3.0 particularly that a new architecture is used which is not a drop in replacement for Grails 2.x. Graeme then got to the meat of the matter and went over some of the goodies in Grails 3.1 which were mostly to do with improvements to application profiles introduced with Grails 3.0 and to GORM 5, the data access toolkit used by Grails – including getting it's own website [7]. The keynote ended with Graeme mentioning a few possibilities for Grails 3.2 such as a Netty [8] application profile and non-blocking GORM support.
Following the keynote I went to talk about Gradle’s new model given by Peter Ledbrook. The desire for the new model stems from wanting to move from having to declare build tasks before use, where configuration order is important, to a declarative style in which declaration order is not important. Peter noted that all configuration is executed whether used or not which can lead to slow builds on large or complex build configurations. The idea is to do something similar to the build execution phase where tasks are only performed if required to complete a particular build. This is achieved by moving from a build tasks description to a build model description and along with it a scary new vocabulary with terms like ‘model space’ and ‘rule sources’. Peter spent most of the talk explaining with examples how all these changes fit together.
For the final session of morning I attended ‘Deep dive into the Groovy Compiler’ given by Cédric Champeau. Cédric started by re-enforcing the fact that Groovy is a compiled dynamic language that compiles down to Java byte code and went on to point out that even though a simple Groovy program may not contain the keyword class under the hood the compiler will generate a class as the JVM works with classes. Because Groovy can also compile Groovy source code at run time – meaning Groovy byte code executables have access to a Groovy compiler – making Groovy executables larger. Cédric listed the 9 Groovy compilation phases and noted that the Groovy console [9] allows viewing the result of each compile phase. The rest of the session was devoted to going into greater depth on many of the compilation phases.
Following lunch I went to a talk given by Jeff Brown on polyglot web development with Grails 3. Polyglot here means using multiple programming languages to write an application, specifically in this case those that target or are callable from the JVM (Java Virtual Machine). Jeff started by re-iterating what Grails is and then moved on to the polyglot programming aspects. The first point noted was that Groovy inter-operates well with many JVM languages, such as Java, directly. However some are different enough that they require some help and Jeff took Clojure as an example of such a beast. A Grails plugin is used to help out and takes care of two main aspects of inter-operability. First it detects when either Clojure code called from Groovy or the calling Groovy code changes and performs the required actions to ensure synchronicity. Secondly it intercedes between Groovy and Clojure to ensure calling Clojure functions looks like calling Groovy class methods.
Another quick break and it was into a mid-afternoon session on serverless microservers using AWS Lambda and Groovy presented by Beniot Hédiard. Beniot started by discussing going serverless on AWS (Amazon Web Services) using AWS Lambda [10] which takes cloud deployment beyond infrastructure and platform as a service to the level of uploading and running functions. Code written in Javascript, JVM based languages – including Groovy of course, and Python – are supported. Beniot then went over moving from a monolithic architecture to one based on microservices which are good for rapid scaling. The idea is to split the the architecture on data and service boundaries and then wire services to react to events, possibly triggered by other services.
For the final presentation of the day, and the conference, I went to ‘Custom Tags – The unsung heroes of the Grails framework’ given by Dave Klein. Custom tags it turns out are custom HTML tags that allow code to be executed to handle them and aid the rendering of GSP (Groovy Server Pages) [11] documents. I was reminded of the PHP based Smarty template engine [12] I came across a while ago. Custom tags I discovered are presented as tag libraries [13], which are simply classes that have names ending in ‘TagLib’ and provide a closure property (a named property that has an anonymous function assigned to it) for each custom tag in the tag library.
To round off the conference there was a hack session until 22:00 in the communal CodeNode space for people to split into groups to work on one of the suggested items that required some work. As I knew nothing, as it were, I sat with Schalk and and observed while showed some code to someone. After a while, and well before 22:00, we left.
Postscript
My conferences budget usually only stretches to the ACCU conference in April each year [14] so I very much appreciated the opportunity to be able to attend Groovy and Grails eXchange 2015 and learn a bit about things that I had tagged as interesting and should find out more about at some point, one day, maybe...So thank you Schalk!
Coming from a little or no knowledge position I found all the presentations useful and now have information on a range of technologies and tools I can follow up on. However, I suspect that in some cases the information I took away differed from the main message of the presentation. If pushed I might list the following as things I found particularly interesting:
- Grails as a candidate for a framework I could like using.
- Gradle as a modern build tool, especially using Groovy/Gradle for automation glue.
- Groovy AST transforms as they sound intriguing.
- AWS Lambda and microservices as an interesting way to divide up large applications.
I would certainly consider putting the likes of Groovy, Grails and Gradle to use and maybe some of the other technologies mentioned along the way as well.
References
[1] Groovy & Grails eXchange 2015: https://skillsmatter.com/conferences/6863-groovy-grails-exchange-2015
[2] SDKMAN: http://sdkman.io/
[3] Gramazon: https://github.com/aestasit/gramazon
[4] sshoogr: https://github.com/aestasit/sshoogr
[5] p-unit: https://github.com/aestasit/p-unit
[6] Spock framework: http://spockframework.org
[7] GORM 5: http://grails.github.io/grails-data-mapping/latest/
[8] Netty: http://netty.io/
[9] groovyConsole: http://www.groovy-lang.org/groovyconsole.html
[10] AWS Lambda: http://aws.amazon.com/documentation/lambda/
[11] Groovy Server Pages: https://grails.org/single-page-documentation.html section 8.2, Groovy Server Pages
[12] Smarty Template Engine: http://www.smarty.net/
[13] Grails custom tags: https://grails.org/single-page-documentation.html section 8.3, Tag Libraries
[14] ACCU Conferences: http://accu.org/index.php/conferences
Notes:
More fields may be available via dynamicdata ..