While browsing I encountered on Vimeo the video of my Getting Groovy presentation at Gr8Conf 2013 in Copenhagen. This is an introduction into Groovy with some theory and a lot of live code samples.
While browsing I encountered on Vimeo the video of my Getting Groovy presentation at Gr8Conf 2013 in Copenhagen. This is an introduction into Groovy with some theory and a lot of live code samples.
Today the weather is totally different than yesterday. The sun is shining and it promises to be a good conference day. After yesterday's university day it is time to get ready for the official first conference day. The conference has two tracks packed with exciting talks, so it is difficult to choose.
The day started off with a welcome speech by Søren Berg Glasius. This year is the 5th anniversary and the people that went to all 5 conferences got a surprise: a free ticket for the 2014 conference. Then a great keynote talk: The rise and fall of empires: Lessons for language designers and programmers was given by Venkat Subramaniam. Here he used analogies with history, wars, democracy to show that everything is moving. And that one language that is trying to revolutionise (the new kid on the block) will become a resister once it is on top. And this will go on and on and on. He also mentioned it is good to learn different languages, but try to learn really different languages. So if you are a Java developer C# is not that different, try for example Haskell or Ruby. Venkat is a great speaker and this was a very entertaining keynote.
Next I went to the Lift off with Groovy 2.1 session by Guillaume Laforge. He is the Groovy project lead and we were presented with a lot of new features added in Groovy 2.0 and 2.1, but also what to expect from Groovy 2.2 and 3.0. He gave GVM a special mentioning, because it is very good tool to install all kinds of Groovy versions and other Groovy technology related tools. The mean theme for Groovy 2 is static type checking and compilation. This will continue and also extra support for DSLs will be added. Still nice things to come this year and with 3.0 planned for next year.
The following session, Raspberry Pi à la Groovy FX, was presented by Stephen Chin from Oracle. First he showed some of the uses of the Raspberry Pi. Then we learned how to install a JVM on the Pi so we would be able to run Java applications. With an ingenious setup he was able to show this on the video screens by using video capture, a lot of cables and a media player. This was very nice. The second part of the session was about JavaFX and GroovyFX. GroovyFX adds a very elegant DSL to work with JavaFX. Stephen showed how a lot of Java code can be reduced by using GroovyFX. Finally he showed a nice graphical application fed by real-life conference data running on the Raspberry Pi. This application was actually used during the conference to show the agenda.
Lunches at any Gr8Conf are delicious and this year was no exception. We enjoyed our lunch, while also listening to Dierk König telling about Open Dolphin. This is an impressive library with not that many lines of code, but very powerful for running rich GUI clients written in Java and still running and executing the business logic code on a server.
The next session after the lunch was given by Graeme Rocher and was about Road to Grails 3.0. He showed some very exiting features coming up in the next 2.x release. For example much improved dependency management, cross side attack prevention, REST support, data binding and asynchronous support. In Grails 3.0 we can expect Gradle to be the default build/task system and application profiles will be introduced. It is good to see Grails has a very active community and the Grails developers are doing an awesome job creating these new features.
Next up was the session Functional programming in Java by Venkat Subramaniam. In a fast paced and very energetic session he showed some of the more functional features in Groovy as compared to Java. Although Groovy is not a functional language per se we can still use Groovy features to avoid mutable state. With some lively examples he showed difference between Java and nice clean Groovy code.
During the coffee break there was a surprise, because this is the 5th Gr8Conf. Three beautiful cakes with the Groovy, Grails and Gr8Conf theme were served by Guillame, Greame and Søren.
After the coffee break I joined the session Building Grails apps with Gradle by Luke Daley. Although the Grails plugin for Gradle is not completely finished it is very usable. Especially if Grails is part of a bigger project and we want to make sure we have an unified build this is a good solution. By using Gradle we don't have to define dependencies anymore in Grails, but we use Gradle for that. We can also write Gradle tasks that will invoke Grails commands as a way to create for example aliases. I really want to try and use it for our project, because it involves both Java components and Grails applications and plugins.
The final session was Grails under the hood by Graeme Rocher. This was a nice session, where Graeme opened up the Grails source tree in IntelliJ IDEA and walked through the modules and showed their usage and some of the code behind the magic we experience when using Grails.
The days was ended by a Meet 'n Greet BBQ. The Gr8Conf organisers brewed three kinds of beer to go with the food. And even the weather was nice, so it was a gr8 ending for this first conference day.
The day started out cloudly and with a lot of rain. Fortunately the rain stopped during the day and for the next few days it should stay dry. This makes the walks to and from the hotel more comfortable. After registration there was some sweet pastry and drinks. For me the day started with presenting Getting Groovy, a beginner workshop for working with Groovy. It was nice to see people get there first contact with Groovy through Gradle and Spock on their Java projects. The presentation and notes are available online.
After a good lunch I went to the GPars workshop presented by Rusell Winder and Václav Pech. This is a topic I wanted to get my hands on for a longer time and this time I really could. Russel and Václav covered threads, agents, fork/join, parallel collections, data flow and actors. All backed by exercises we could do to use GPars for real. This was really good and also why I enjoy the conference, because you can use this time to really play around with gr8 technologies. The session was packed with information, hands-on exercises and really fun to follow.
And this was my lucky day, because the next workshop was about Unleashing the power of AST transformations. Another topic I really want to work with, but didn't have the time yet to get started. The workshop was presented by Andres Almiray and Cédric Champeau. Andres started out by an introduction to AST and his personal experience when he started to write his first transformations. Although it might look a bit intimidating writing AST transformation is something to start doing and then you probably won't stop. After the introduction it was time to open IntelliJ IDEA and work on the exercises and start writing AST transformations for real. This was great and really inspired me to start using this on my own projects. Cédric and Andres also gave some very useful tips for developing and testing transformations.
Directly after the last session it was time for pizza and soda. These were arranged by Canoo as part of Hackergarten on tour. During Hackergarten we should have fun, learn and work on some open source projects. Anders made a list of suggestions of things to work on and then the crowd was divided in small teams to work on tasks. The goal of Hackergarten is also to choose tasks that can be handled in a 2-3 hour time period, so at the end of the session code can be really committed back to the open source project. The good thing about Gr8Conf is that almost all project leads of those project are here, so changes can be done directly. I worked with Dierk Köning on fixing and cleaning up some of the tests and code of Open Dolphin. This was really fun to do and he also gave me some useful tips on using IntelliJ IDEA and vice versa. We were able to push fixes into the repository and at the end of the evening we achieved a 100% statement coverage again.
So this day was packed with a lot of information and was really fun. I am ready for the next day.
The final day of Gr8Conf 2012 in Copenhagen. The first conference day was really inspring, so I was ready for my second day and learn a lot from all the great presenters. The day started half an hour earlier than the day before, but it seemed not everybody knew this. During the first session a lot of people arrived and had to sneek in while the session was already on the way.
The first session I went to was Grails EE. The title might suggest that Grails will be part of Java EE, but it was a presentation about a real big Grails project and the lessons learned from the project. Ivo Houbrechts did a good job explaining the nice things Grails added to the project, but also pitfalls. I really like the parts where he showed how they achieved a lot of code reduction by implementation AST transformations. The code really looked much beter after this redesign and also the repetitive code blocks were gone. Also the addition and use of UI components was great. Cleaning your code and applying the DRY principle also needs to apply to the view layer in the application. On the project several specific project plugins and some are also available for use like the GSP taglib plugin and Rich Domain plugin. I got some very good ideas from the presentation.
Next up for me was the GPars session presented by Russel Winder. This was a fun session. Russel is a great presenter and capable of explaining complex subjects with humor and make it understandable. GPars is a library part of Groovy (but can be used standalone with Java apps as well) to support parallelism. Now a days the computer power of a single CPU core is limited. To improve performance we should use parallelism, so use multiple processors, to execute our code. Threads are something we shouldn't care about in our applications. They are part of infrastructure and we shouldn't manage them. With several examples we saw how different models of parallelism can influence the outcome and performance. There is no one-model-to-rule-them-all, we need choices. And GPars provides these choices with actors, dataflow and Communicating Sequential Processes (CSP). The nice thing is that all these models are developed somewhere in the sixties and seventies of the previous century. You can read more at Russel Winder's website.
After a coffee break I attended the Hacking the Spring Security Plugin presented by THE Burt Beckwith. Burt is a great presenter and how showed us all the different parts that make up the Spring Security plugin. We can pick and choose a lot of the components/filters and reconfigure them in our own application. The plugin is very flexible (as is the underlying Spring Security) and we can reconfigure parts easily. In the end there is a lot of Spring stuff underneath and we can reconfigure it by overriding components or setting properties.
Peter Ledbrook presented the Asynchronous IO on the JVM: Vert.x session. Vert.x is like Node.js, but we can use Groovy! Writing Vert.x code is very easy as Peter showed us. We write modules that will interact via an event bus. We don't have to worry about the event bus, it can run in a single JVM, but can also spawn multiple JVMs on different computers. Scaling a Vert.x application is very easy. With a concrete example we saw how easy it was to see real-time logging from a Grails application in a Javascript application running in the browser.
After lunch it was time for my final session on this Gr8Conf: Gradle Hidden Gems. I showed with several examples how we can work with Gradle build files. Different command-line options, task configuration and more were covered. During the talk I made the classic Gradle mistake to create a new task and leaving out the leftShift operator (<<), which would only configure the task. But the nice thing about live coding is that the audience will always help and try to find out what went wrong.
Next I went to Luke Daley's session Releasing Software with Gradle. He showed with a lot of example code how we can use Gradle for a project that we want to deploy to Maven Central repository. All steps necessarry were covered. Like creating a correct POM, signing the JAR file and uploading multiple artifacts to a Maven repositories. Very insightful and showed there is no excuse not to use Gradle. Luke also put the code on GitHub as reference.
I couldn't attend the last two sessions of the day, because I had to catch my plane back home. Which was unfortunate, because in the last two sessions interesting Spock things were covered and also Betamax, a tool to interact with HTTP services in tests.
Gr8Conf 2012 Europe was packed with interesting sessions. If you are developing Grails applications, work with Gradle, write test code with Spock or Geb, or use any other Gr8 technology, you should really attend this conference. Everybody is really approachable and it is great to meet the people behind all the projects. Mostly we know their names, but it is good to meet them in real life. Copenhagen is a great city with friendly people that speak English easily and ready to help. The conference takes place at the IT University and has nice auditoria to follow the session, while you can use your laptop to immediatelly try things from the session. The organizers did a great job organizing the conference (they even went through the "trouble" of brewing a special conference beer!). Thank you very much and hopefully see you all next year!
After the university day the conference now really starts with a lot of sessions. Aside from the first session all sessions are in parallel tracks. This means you sometimes have to make though choises. Luckely a lot of the presentations or code from the presentation is online. If we go to the Gr8Conf website and look at the Presentations page we can go directly to a presentation. On that page we see more about the subject and the speaker, but also the presentation itself is included or a link is available.
Søren Berg Glasius started the day and gave us a very big welcome to the 4-th Gr8Conf Europe. Guillaume Laforge presented the first session Groovy Update: What's New in 1.8 and What's Coming in 2.0?. First he gave a short recap off all the features that were added in Groovy 1.8. But quickly we got to see what is in store for Groovy 2.0, which is just around the corner. First of all Groovy will be more modular. This means we don't need to have a big JAR file to work with Groovy, but we can decided which parts of Groovy we need. The core itself will be small and we have modules like console, XML, templates and more. Also Groovy 2 will have JDK 7 alignments. It will use invokeDynamic which is in JDK 7 to improve performance. And finally we get static type checking and static compilation.
After a small coffee break it was for my session Grails Hidden Gems. I showed with live coding many features of Grails. It is stuff you probably read about or used before, but somehow forgot it was there. Or maybe you didn't even know that it was possible with Grails. The small code snippets I used are available on GitHub. Mean while at the other room of the conference Andres Almiray released Griffon 1.0! Would have loved to be there and celebrate the moment, but that is what Gr8Conf is about: making though choices (or you need to present, while in the other room there is a great session).
Next I went to the Testing with Geb session. I already read some stuff about Geb, but I never got around to use it in my projects. After a great presenation by Luke Daley I am convinced I really need to do this in my projects. Geb has a very concise syntax to define tests or specifications. It can be used in JUnit tests or Spock specifications. Also we can abstract pages and use variable definitions with closures to define constraints and behaviour for a page. And with a jQuery like syntax we can traverse the generated HTML structure and use that for simulating user behaviour. To simulate a browser Geb uses Webdriver, the successor to Selenium. This is very flexible and allows to simulate for example Firefox, Chrome or Internet Explorer. We can even do mobile browsing.
After a good lunch Graeme Rocher presented the Grails Update session. He showed all the cool features that were added in Grails 2.0. Then he showed what is happening for the Grails 2.1 release. A lot of effort is put into the Maven plugin. It turned out developers working on Grails projects wanted or needed to support Maven for the company's build system. So that way a Grails application can be part of a bigger suite of applications and with proper Maven support it would be fully supported by their build systems. Also the cache plugin is updated in Grails 2.1. There is now an API, which is independent of the underlying implementation. Plugin authors should use this API and the Grails developers can configure the underlying caching mechanism for their application. In Grails 2.2 we may expect that Groovy 2 will be supported.
Next up was my Groovy Hiden Gems session. In this session I went to a lot of the cool features of Groovy with live coding. All mentioned samples are already described in my blog. So this was a subset of those blog posts showing off how Groovy can make your development live easier.
In the Gradle in the Enterprise session presenter Luke Daley showed how Gradle can be used in enterprise projects. Enterprise means big, a lot of dependencies between many projects, legacy projects and a heterogeneous environment. Gradle is really suited for this scenario as Luke showed. We can even define a company configured Gradle build and put it up in one location. We can define which scripts need to be executed for a Gradle build. The incremental build support really speeds up the build process, so even for big projects the build will be fast. Also we can create a specific build DSL for our projects, so we use the same 'language' in our build system as we would use when we talk about it in person. At the end of the presentation Peter Niederwieser showed how well Gradle already integrates with Eclipse (via STS). Gradle exposes a tools API, which is invoked by the Eclipse plugin. People from Gradle are developing the tools API, but the people at SpringSource are writing the Eclipse/STS plugin.
The last session of the day I attended was Keeping your Grails code clean. Andreas Aredal showed how we can apply the Clean Code rules of Uncle Bob to a Grails application. He gave pointers on how we can reduce the amount of repetition in our code base. Also how we can use informative method names and the like. It was interesting to see how we can apply good developer's craftmanship to a Grails application.
The day ended with a nice BBQ where we could mingle and speek to all speakers and attendees.
Going to Gr8Conf is great! You can meet all the good people that develop those amazing Groovy products and projects. You get to learn a lot during 2 (or 3) days which are packed with very informative presentations. Also the fact that you don't have to worry about the "problems-at-the-office" your mind gets into gear. And for me that always results in a new burst of energy and ideas.
Here is my short list from the conference sessions:
And then my mind started to wonder off:
This year's Gr8Conf Europe in Copenhagen started with a University day. During this day longer sessions are presented to dive deeper into a subject and use a workshop to give the audience hands-on exercises. I presented the Getting Groovy session with an introduction to Groovy. The presentation and accompanying document are available. During my session there was also Gradle bootcamp session. From what I've heard Peter Niederwieser and Luke Daley did a great job introducing Gradle to the audience.
After the lunch I visited My "Perfect" Toolchain Setup for Grails Projects presented by Stefan Armbruster. He gave a good overview of all aspects that relate to a good project setup. Not only the technical stuff like continuous integration, ticket systems, wiki, but also project organization and methodology were covered. It was good to hear the things we do ourselves on projects were also mentioned by Stefan. Stefan provided the audience with a pre-configured virtual machine to be used during the workshop. At the same time the session Creating Responsive HTML 5 Applications in Grails was presented by Stephen Pember. During a workshop the audience was instructed to build a HTML 5 application with Backbone.js
After these two sessions I had to choose between GAELYK bootcamp and Jumpstarting Griffon. I went to the Griffon session presented by Alexander Klein and Andres Almiray. Here we saw how easy it is to write a Griffon application especially if you know Grails. Griffon also provides a very good structure to group the MVC parts in a MVC group. A lot of things are automatically done with Griffon if we follow conventions. This makes writing a GUI Swing application easy. Then like with Grails we can install plugins to add extra functionality to the application in an easy way. After the presentation I was (again) very enthusiastic about Griffon and I really (really) need to work with Griffon in the near future.
The first day ended with Hackergarten. During Hackergarten we can contribute to an open-source project. And because a lot of the core contributors are in the room it is a great to 'hack' with them on the code. Unfortunately I couldn't attend Hackergarten, because I had to get up very early on this day to be on time in Copenhagen.
I enjoyed a really great Gr8Conf 2012 in Copenhagen. I presented four sessions this year. As you might know I tend not to have any slides, but love to do live coding. Which means you must have been there to be able see what is covered. But for the university session Getting Groovy I have written a 60+ page document with text and code samples. Also there is a slide deck for this session.
For the Grails Hidden Gems session I have pushed the code I have written (and wanted to have written during the session, but one-hour is not that much if you want to show all cool Grails stuff) to GitHub. The Groovy Hidden Gems was also live coding and unfortunately I didn't save or record the code. The code I have written in my last session Gradle Hidden Gems is also on GitHub.
A while ago I wrote a blog post Groovy Goodness: Getting the Sum of Items in a Collection. Today I presented about this little topic as part of the "Groovy Hidden Gems" session at Gr8Conf 2012. One of the attendees noticed the code where we calculate the sum of the Person objects was not working. So it time to revisit this topic.
The problem with the presented solution is that with more than two elements in the list the code throws an exception. The return method of the plus() method is a BigDecimal so Groovy tries to invoke the plus() method on the BigDecimal class with a Person type argument. And that doesn't exist, hence the exception.
To fix this we must return a new Product object from the plus() method with the sum of the price property. The code is now:
class Product {
String name
BigDecimal price
Product plus(Product other) {
new Product(price: this.price + other.price)
}
}
def products = [
new Product(name: 'laptop', price: 999),
new Product(name: 'netbook', price: 395),
new Product(name: 'iPad', price: 200)
]
assert 1594 == products.sum().price
EDIT: I like to thank the people that wrote a comment. The current solution focuses on the implementation of a plus() method in a class to get a sum value. But we can also use a closure for the sum(). In the closure we define the property to calculate the sum for. Or we can use the optional spread operator to get the price property of all products and invoke the sum() method.
assert products.sum { it.price } == 1594
assert products.price.sum() == 1594
assert products*.price.sum() == 1594
The final day of the conference, the last day I could go to informative and inspiring sessions. The whole day there will be parallel sessions, so here is a report of the sessions I have choosen to attend. We can also read the conference reports of day 1 and day 2.
Introducing GContracts presented by Andre Steingress was the first session of the day and it was great. GContracts is a cool product and can really improve the quality of your code. This is really something I want to use in my projects. With GContracts we can add annotation to our classes and method to ensure post-conditions, set required pre-conditions and class invariants. The syntax is simple so it easy to get started.
The next session was about myBalsamiq. This is project colaboration website to work on Balsamiq mockups that will be released later this year. And it is built using Grails! It is cool to see such a site with a lot of interaction and big user base is created with Grails. Also the architecture of the application was very intesting and looked really great. I wish them good luck with the launch of their product and it will be a great new testimonial for Grails applications.
Gaelyk was the subject of the following session presented by Guillaume Laforge the author of Gaelyk. Gaelyk allows us developers to use Groovy on the Google App Engine. First we learned about the way Google App Engine is positioned in the cloud and the payment model.
Also we took a good look at the services Google gives us developers to use, like datastore, memcache, image manipulation, email. Then it was time to see how we can use all this in a Groovy way. All Google services are directly usable in our Groovy code, because the services are added automatically through bindings. Also several DSLs are applied to make using the services easier. With a bit of live coding we could see this in action.
Gaelyk also has a plugin system, so we could write reusable parts as plugins and use them in our code. The presentation is available on SlideShare.
The session about Spock, my favorite test framework, was presented by Peter NiederWiesser who wrote Spock. The first part of the session was an introduction to Spock for those that didn't know Spock before. With small samples we could see how JUnit tests turned into beautiful Spock specifications. With a state machine and interaction sample this was very helpful.
The second half of the presentation was about the more advanced features in Spock for those that already knew Spock. Writing extensions for example is very easy in Spock and Peter showed this with a sample.
The code Peter used is available on GitHub.
Václav Pech gave a session about GPars. And because GPars is now part of Groovy 1.8 we can all use the very usable features of GPars to create concurrent and parallel running application code. Concurrency will play a big role in the future to create performant applications and with GPars we use Groovy to this. Multi-cores are already here and we will get more of them in the future in all our computers and appliances. And the good thing is, the implementation of the code is not difficult. For example to work with collections in parallel we only add two lines of code and we are done. The impact on the code is also small.
We can also choose to use the dataflow variable paradigm to create concurrent code, which will require a code rewrite, but the result is very elegant and will probably be worth it.
Finally Václav showed how actors can be used and how easy it to write the code. GPars is really something for me to get into in the near future and want to implement in my projects.
Testing is very important when we write code and the next session, Testing with Fitnesse, was just about that. Fitnesse is a framework that is used to write test scenarios in a Wiki with a very simple syntax. Erik Pragt and Marcin Erdmann have created a Grails plugin to use Fitnesse in Grails applications. First Erik gave a small introduction on how we can use Fitnesse and how the plugin uses Fitnesse to run tests. Fitnesse is best used for more complex business logic and is addition to unit tests written in for example Spock.
Then Marcin gave an impressive live coding demo to show TDD with Fitnesse and the plugin. Starting from scratch by writing the test scenarios and then implementing the logic in code.
The presentation was very good and gave a good idea about what Fitnesse is about and the power of it.
The final session of the day I attended was about Building Progressive UIs with Grails by Rob Fletcher. Rob explained why it is important to write progressive UIs for the web. Although you might think everybody has Javascript enabled in their browser and that it is fast, that might not be the case. For example in corporate environments IE6 is still used and upgrading is not on option. But computers nowadays are not the only devices to access your website, mobile phones, tablets and more devices can access your site. These devices don't have all the latest and greatest features, so be humble when you design a site.
By separating markup, CSS and Javascript and providing a functional website with the lowest standard, we are ready to enhance the user experience with Javascript for those users that can use it. He showed some real life examples for Grails applications. The samples showed the different user experiences for the browsers with disabled and enabled Javascript. This was really cool to see and very useful to use in projects. The code is on GitHub.
A very nice tip was to first test of a request is a AJAX request before applying a layout. This way the views can be reused in a AJAX and normal request without changing the view.
I had to leave for the airport before the panel discussion, which I couldn't attend unfortunately.
The overall feeling of this conference is that the Groovy community is very social, friendly and open. I learned a lot during these 3 days and just as last year my list-with-things-to-look-into-and-learn-more-about has grown again. Hopefully I will be able to cross most things off, before next year's Gr8Conf. Because Gr8Conf 2012 is already marked in my agenda.
After already a first great university day it was now time for the official start of the conference days. After Søren's welcome speech it was for time for Guillaume Laforge to present his brand new presentation about Groovy 1.8. He touched on all the interesting new features we can find in Groovy in his presentation.
The new command chain expressions even allows us to leave out dots when we invoke methods so we can write even nicier and more natural language like DSLs. A lot AST transformations have been added in Groovy 1.8, closure methods, JSON supports, compilation customizers and much more. The slides are available on SlideShare.
Next up was the Grails update. Peter Ledbrook showed us all the goodies we can expect in Grails 1.4. For example we get better looking (supporting progressive Javascript/CSS using HTML5) scaffolding templates. Also we get a complete GORM API implementation for testing purposes. This means everything that is available in the GORM API can be used in a testing enviroment. Yes, even Criteria calls will work! This is all implemented as mix-ins, so we can use it in JUnit testcases, but just as easy in Spock specifications. We don't have to extend our test classes from a specific Grails testcase anymore. The new test report UI is very impressive and looks very useful.
Also a lot of libraries are upgraded for the upcoming Grails 1.4 release, like Spring, Hibernate, Groovy. Tomcat 7 will be the default servlet container. Also hot reloading of classes has been improved. A special agent is used for the JVM, that allows class reloading for almost all classes of the application the speed up development even more.
The database migration and resources plugins will become part of Grails. In the not so near future we can expect Grails 1.4 M1 to be released so we can experience a lot of these nice features already and try them.
Also Peter explained they want to get a better insight to see how plugins are used and for example how many times a plugin is used. With this data the usefulness of a plugin should be more clear to developers when they want to download and use a plugin.
Both the Groovy and Grails update session where single track session, but the rest of the Gr8Conf was with 2 tracks. So I had to make choices and cannot cover every session in this report. I attended the Adopting Grails session, about how Grails can be implemented in a real world situation. Even integrated with another Java web application. We learned how we can split up a Grails application using plugins into several parts. For example a plugin to define only the services layer. This way the plugin could be used in a Java and Grails application. Also we learned that still Java developers are a bit scared of Groovy. If they have to fix bugs in parts of Groovy code with for example a bit of dynamic programming then they couldn't get it.
After the lunch I attended the Gradle Update by Peter Niederwieser. He works at Gradleware and did a good job explaining Gradle. First he showed how easy it is to get started with Gradle of you come from an ANT build system. It is basically just a matter of importing the ANT build and you are ready to. He also show how you can re-use your Maven build from Gradle. He created a new task rule to intercept the commands and then invoke Maven through an exec invocation to get the Maven build going. And of course he showed that Gradle doesn't need much code to use it for a Java (or Groovy) project that already uses the Maven standards for directory structure. Gradle of course shines with parallel test execution, the fact tasks are only executed when they need to be by looking at input and output variables and Peter showed how this works.
Next up was my own presentation for CodeNarc & GMetrics. I did a live coding session where we started to take a look at a bit of Groovy code and then see which CodeNarc rules where fired. We learned CodeNarc contains many rules and they are also great for new Groovy developers to learn about how you code can be more Groovier. CodeNarc has for example a lot of rules that will tell you that certain parts of your code are a bit Java-ish and how to turn into something more Groovy-ish. I explained how can use the configuration to change rule priorities or even disabled them completely. We learned how to customize certain rules and I wrote a complete new rule and showed how it could be used in our CodeNarc analysis.
GMetrics is more about calculcation and reporting of code metrics like ABC (Assignment/Branch/Condition) counts and cyclomatic complexity. We finally looked at how we can customize the report from both tools.
The next session I attended was Paul King's Groovy Testing. The focus was on how Groovy can be used for testing with web drivers like HTMLUnit. He explained the many possibilities that are out there to do testing and you probably will need a combination of different techniques to get a satisfying test outcome. There is no one golden solution to cover each testing need. Each project has different characteristics and therefore different testing needs. But Groovy is very powerful to use for testing purpose, because the language is so powerful and dynamic that is easy to express your testing needs.
He also told us to create a testing API or DSL for your own testing to provide an abstract layer between how you express your tests and the real test implementation that can be used.
He ended with showing how you can use Groovy to generate test data for your testing. Different scenario's can be created with combinations of test data, but you can also for an optimal instead of a maximal set of test data to keep your tests running quickly. On SlideShare we can find slides that where used during the presentation.
The last session for the first day I attended was Effective Groovy by Hamlet D'Arcy. Following the guidelines and rules from Effective Java he showed how to implement those rules in Groovy. And of course the power of Groovy really shines when we only have to one-liners or add annotations to implement the Effective Java rules.
He also added new "Effective Groovy" rules which are not in Effective Java but apply to Groovy applications. A lot of the rules were already implemented with the new Groovy 1.8 features, so it was great to see these features already mentioned and shown. The presentation was a lot of fun and just showed again how powerful Groovy really is. Hamlet also posted the slides.
To end this beautiful and great first conference day we were treated by snacks and beer for a social gathering between all conference attendees. Thank you Gennemtaenkt for organizing this tasty and fun meeting.
Read more about day 3.
For the first time this year Gr8Conf organized a university day. On this day 3 hour sessions where given about Groovy (in the morning) and Grails (in the afternoon). In the morning I did the session about Getting Groovy together with Søren Berg Glasius (one of the organizers of Gr8Conf). We had a lot of topics to cover and didn't make it to cover it all during the session. Luckily we created a big document with all the topics and a lot of sample code (also from the Groovy Goodness blog series) for the attendees. So hopefully people will look into the document to learn more about the topics we couldn't cover.
Also in the morning was a more advanced Groovy session about AST transformations by Hamlet D'Arcy. I couldn't attend this session, but after 3 days of Gr8Conf I can say AST is now at the top of my agenda to look into further. AST is powerful and provides many benefits for developing Groovy applications.
The afternoon sessions where about Grails. The Grails Kickstart session was a beginner's session on how to create Grails applications. I attended the session about How to write a Grails plugin presented by Burt Beckwith. Burt is of course a famous Grails plugin developer and he has a lot of plugins he contributed to or developed. We learned that writing a Grails plugin is not that different from writing a Grails application. He explained the small difference and also the little pitfalls. During the session he wrote a calendar plugin that was able to communicate via the Google Data API to get and save the data. The source code is on GitHub. The session was very useful and provided enough insight to get me started on writing a Grails plugin myself.
And then after the session it was time for Hackergarten hosted by the guys from Canoo. At Hackergarten people get together and work in small teams on (open source) projects. The goal is to have real contributions to a project at the end of the evening. This is of course a great way to get involved into an open source project and become one of the contributors. I joined the team developing new rules or fixing bug on rules for CodeNarc. Hamlet D'Arcy took the lead and give some outstanding issues that needed to be fixed or new rules that needed to be written. We paired up and wrote an extra addition to the ConfusingMethodName rule. It is great that I now contributed a small part to CodeNarc and the evening was really inspiring.