Paul King
co-author of "Groovy in Action"
Paul King leads ASERT, an organization based in Brisbane, Australia which provides software development, training and mentoring services to customers wanting to embrace new technologies, harness best practices and innovate. He has been contributing to open source projects for nearly 20 years and is an active committer on numerous projects including Groovy. Paul speaks at international conferences, publishes in software magazines and journals, and is a co-author of Manning's best-seller: Groovy in Action.
Presentations
Industrial Strength Groovy
You've used Groovy to quickly hack together some short scripts or a simple Grails app. Now you want to treat it more seriously and apply best practices and tools. For Java you'd look at style and coverage checkers, JavaDoc, dependency injection, mocking, testing and build frameworks. For Groovy you have EasyB, Cobertura, CodeNarc, Simian, GroovyDoc, Hudson, Ant, Maven, Gant, Gradle, Spring, Guice, Spock, GMock and more. The talk is packed full of tips and examples for these and other tools.
We'll examine these tools: * EasyB: for writing acceptance tests * Cobertura: for checking code coverage * CodeNarc: for checking code style * Simian: for checking code duplication * GroovyDoc: for writing documentation * Hudson: for CI builds * Maven/Ant/Gant/Gradle: for build files * Spring/Guice: for dependency injection * GroovyMock/Spock: for mocking and testing * OSGi: for writing bundles
How to make your testing more Groovy
Testing can be a complex and thankless task. The technologies change so fast that your tools don't work as they should or you have to write lots of low-level boiler-plate code that is obsolete almost as soon as it's written. Your tests are brittle and hard to relate to customer requirements - you aren't even sure that you are testing the right things. Let's explore some techniques and tools for easing some of these burdens and try to move testing from tedious and hard to easier and fun!
We quickly sample a flavor of many techniques and tools including these topics: * Using Easyb for BDD flavored acceptance tests * developer testing using JUnit 4, TestNG, Instinct, Spock and GMock * writing domain specific testing languages (testing DSLs) * testing web applications with WebTest, Tellurium, Selenium and WebDriver * testing RESTful and SOAP flavored web services * testing databases with DbUnit * testing rich clients and GUIs with FEST * performance testing with JMeter * leveraging AllPairs, All combinations and other testing techniques * model driven testing
XML and Web Services with Groovy
Groovy provides excellent facilities for parsing and creating XML. As well as providing syntactic sugar on top of traditional Java-based parsing approaches (e.g. SAX, DOM, StAX), it has its own XmlParser and XmlSlurper libraries which support XPath-like expressions at the object level (akin to LINQ in the .Net world). In addition, Groovy's markup builders provide an elegant and efficient way to create and modify XML. Groovy also has various options available for SOAP and RESTful web services. We'll examine the most popular of these.
We'll cover: * Reading, creating and updating XML using various approaches including the pros and cons of the various parsers and markup builders * dealing with XML namespaces and XPath * using other XML frameworks: XOM, Dom4j, JDom * integrating with XSLT, XQuery and validators * treating non-XML like XML * GroovySOAP, GroovyWS and Spring web services * JAXB, XmlBeans, CXF and Axis2 for SOAP web services * XML-RPC and RESTful options, RSS, ATOM * trade-offs using Apache Xerces or with native XML support on 1.4 through to 1.7 JVMs * Testing Web services with SoapUI * A quick look at Groovy integration in common XML/web-service tools * Groovy use in web service related products including ESBs and SOA frameworks
Agile Developer Practices for Dynamic Languages
Developer practices for traditional and agile Java development are well understood and documented. But dynamic languages (Groovy, Ruby, and others) change the ground rules. Many of the common practices, refactoring techniques, and design patterns we have been taught either no longer apply or should be applied differently and some new techniques also come into play. In this talk, we'll relearn how to do agile development with dynamic languages.
- What Java practices should you "unlearn"!
- Myths and truths about dynamic typing
- Interface-oriented style versus duck-typing vs chicken-typing
- Better patterns: Adapter, Builder, Delegation, Visitor, Strategy, Singleton, Immutable, Factories, Proxies and more
- Refactoring your Refactoring and Closure refactoring
- Applying functional style with closures and currying
- Pondering the relevance of the open-closed principle
- Do you need dependency injection when you have a MOP?
- Examining the need for mocking and testing frameworks
- Dealing with Feature Interaction
- Practices to consider when writing DSLs
Groovy.DSLs(from: beginner, to: expert) 2011 Edition
This talk examines how dynamic languages in general and Groovy in particular take us toward the goal of writing programs for a particular domain using phrases that look familiar to subject matter experts from that domain. Groovy, is a popular and successful dynamic language for the JVM. It offers many features that allow you to create embedded Domain Specific Languages(DSLs) including Closures, compile-time and run-time metaprogramming, command chain expressions, operator overloading, named arguments and other concise syntax conventions.
The talk highlights many of Groovy's DSL capabilities through numerous realistic examples. We'll give the example, explain the tricks used to implement the DSL, including any pros and cons as well as tackle the often forgotten but key aspects of readability vs complexity, testability, evolution, and the various considerations to keep in mind while designing DSLs.
Acceptance Testing with Groovy
An ideal way to make use of Groovy's great support for writing domain specific languages (DSLs) is when writing customer or acceptance tests. When using such an approach you typically use a high level English-like testing DSL to express the test. The approach is so popular that in fact numerous frameworks now exist for creating such tests.
We will examine a few of the more popular frameworks and glimpse at a few of the more exotic choices. Frameworks examined include EasyB, Spock, JBehave, Cucumber, Robot Framework, Slim and more. We'll also examine a range of powerful testing approaches beyond these tools which are useful for acceptance testing.
Unit Testing with Groovy
This talk looks at the features offered by Groovy for unit or developer testing including built-in test runners, mocking, test helper classes, Groovy's power assert, and CI and IDE integration.
We'll look at some popular add-on frameworks for Java and Groovy including Spock, Mockito, GMock and EasyB. We'll also review the available coverage and metrics tools including Cobertura, Clover, GMetrics, Simian and CodeNarc.
Solving tic-tac-toe: an addendum to the static vs dynamic typing/OO vs functional debates
TBA
TBA
Software Development Best Practices - Groovy Edition
Over the years we have seen many debates about how best to write and maintain our programs. Should we use OO or functional? Should we use sequential or concurrent? Should we use static or dynamic typing? What design patterns should we use (or anti-patterns should we avoid)? What can we learn from the strengths and weaknesses of the many languages that are now available for us to program in?
In this talk, we give numerous examples which highlight the different ways to code and test our programs. It looks at the trade-offs that different typing and coding styles give you in terms of a number of features including: ease of reading and writing, tool support, ability to modify, ability to make concurrent, ability to test and a number of other criteria. The talk doesn't attempt to provide a single answer to what is the best one true way to code all programs but gives you many examples to ponder and many context-dependent guidelines for you to factor in to your choices.
Groovy and Concurrency with GPars
This talk looks at using Groovy for writing multi-threaded, concurrent and parallel programs. We'll briefly look at leveraging legacy Java techniques such as multiple processes, multiple threads, the java.util.concurrent APIs and shared-state atomicity.
We'll then look as some useful AST transforms in core Groovy (Lazy, Synchronized, Immutable, WithReadLock and WithWriteLock) before divign headlong into GPars. GPars is a comprehensive library for parallel execution that provides a menu of options to the developer.
The different choices available have pros and cons depending on the circumstances. We'll look at the parallel collection support and the optional transparent way to use that support. Then we'll examine Map/Reduce. We'll also look at the DataFlow approach to achieving concurrency, the Actors approach, the use of composable asynchronous functions and the use of Agents and Active Objects.
Finally, we'll peek at Multiverse (Software Transactional Memory) and JCSP, two emerging approaches that might appear more prominently in future versions of GPars. Then we'll wrap up with a brief look at testing multi-threaded programs.
Writing your own Groovy 2.0 module
Learn about the modularization features in Groovy 2.0 including everything you need to know to write and use your own modules.
Provides an overview of the modularization (m12n) mechanism in Groovy 2.0 including: * The different parts of m12n. * The use of m12n features within the standard distribution. * Turning standard features on and off. * How to write and use your own module (illustrated by making modules for some existing open source libraries). * m12n futures (what other features are planned in future releases)
Functional Groovy
Groovy doesn't claim to be a fully-fledged functional programming language but it does provide the Java or Groovy developer with a whole toolbox of features for doing functional style programs. This talk looks at the key Groovy features which support a functional style. Topics covered include using closures, currying and partial evaluation, closure composition, useful functional-centric AST macros, useful functional-centric runtime meta-programming tricks, trampolining, using Java functional libraries, immutable data structures, lazy and infinite lists, using Groovy 2's static typing and approaches for moving beyond Java's type system.
There are many advantages to using a functional style in your programs. Learn what can be done to leverage functional style while retaining many of the productivity gains of the Groovy programming language.
Creating Groovy DSLs that Developers can Actually Use
In this presentation, Guillaume, Paul, and Andrew will show you how to leverage Groovy to build a Domain-Specific Language (DSL) used to control a rover on Mars! Various metaprogramming techniques and integration mechanisms will be demonstrated. But the language itself is only the first part of the story. Developers cannot be expected to properly use a DSL without first-class IDE support and documentation.
The presentation will start by building the DSL from scratch, using the power of Groovy to create a concise and readable mini-language, and showing how to secure its integration. The second part of the presentation will demonstrate how to integrate the DSL into Groovy-Eclipse with custom content assist, navigation, searching, and inline documentation.
Books
by Dierk Koenig, Andrew Glover, Paul King, Guillaume Laforge, and Jon Skeet
-
Groovy, the brand-new language for the Java platform, brings to Java many of the features that have made Ruby popular. Groovy in Action is a comprehensive guide to Groovy programming, introducing Java developers to the new dynamic features that Groovy provides. To bring you Groovy in Action, Manning again went to the source by working with a team of expert authors including both members and the Manager of the Groovy Project team. The result is the true definitive guide to the new Groovy language.
Groovy in Action introduces Groovy by example, presenting lots of reusable code while explaining the underlying concepts. Java developers new to Groovy find a smooth transition into the dynamic programming world. Groovy experts gain a solid reference that challenges them to explore Groovy deeply and creatively.
Because Groovy is so new, most readers will be learning it from scratch. Groovy in Action quickly moves through the Groovy basics, including:
Simple and collective Groovy data types Working with Closures and Groovy Control Structures Dynamic Object Orientation, Groovy style Readers are presented with rich and detailed examples illustrating Groovy's enhancements to Java, including
How to Work with Builders and the GDK Database programming with Groovy Groovy in Action then demonstrates how to Integrate Groovy with XML, and provides,
Tips and Tricks Unit Testing and Build Support Groovy on Windows An additional bonus is a chapter dedicated to Grails, the Groovy Web Application Framework.
Early PDF chapters of Groovy in Action are available from the Manning Early Access Program (MEAP) at http://www.manning.com/koenig. As part of this program, readers can also discuss the early manuscript with the author and help shape the manuscript as it's being developed by joining the Author Forum.
-
Groovy, the brand-new language for the Java platform, brings to Java many of the features that have made Ruby popular. Groovy in Action is a comprehensive guide to Groovy programming, introducing Java developers to the new dynamic features that Groovy provides. To bring you Groovy in Action, Manning again went to the source by working with a team of expert authors including both members and the Manager of the Groovy Project team. The result is the true definitive guide to the new Groovy language.
Groovy in Action introduces Groovy by example, presenting lots of reusable code while explaining the underlying concepts. Java developers new to Groovy find a smooth transition into the dynamic programming world. Groovy experts gain a solid reference that challenges them to explore Groovy deeply and creatively.
Because Groovy is so new, most readers will be learning it from scratch. Groovy in Action quickly moves through the Groovy basics, including:
Simple and collective Groovy data types Working with Closures and Groovy Control Structures Dynamic Object Orientation, Groovy styleReaders are presented with rich and detailed examples illustrating Groovy's enhancements to Java, including
How to Work with Builders and the GDK Database programming with GroovyGroovy in Action then demonstrates how to Integrate Groovy with XML, and provides,
Tips and Tricks Unit Testing and Build Support Groovy on WindowsAn additional bonus is a chapter dedicated to Grails, the Groovy Web Application Framework.
Early PDF chapters of Groovy in Action are available from the Manning Early Access Program (MEAP) at http://www.manning.com/koenig. As part of this program, readers can also discuss the early manuscript with the author and help shape the manuscript as it's being developed by joining the Author Forum.