Learning Groovy
Learning Groovy (The Book + Code)

Retired

This book is no longer available for sale.

Learning Groovy

This book is 100% complete

Completed on 2016-03-02

About the Book

Who is this book for?

Although this book is somewhat intended for those with a Java background, anyone with basic programming skills could benefit from it. This book is a data-filled, yet easy-to-digest tour of the Groovy language and ecosystem. Now at Apress

This book covers:

  • Groovy basics, including the GDK
  • Advanced Groovy, such as writing Groovy DSLs
  • Functional programming in Groovy
  • GPars, the built-in concurrency library
  • Gradle, the build system
  • Grails, the web application framework
  • Spock, the testing framework
  • Ratpack, the reactive web library

Groovy is a flexible open-source language built for the JVM (Java Virtual Machine) with a Java-like syntax. It can be used dynamically or statically-typed, your choice. It supports functional programming constructs, including first-class functions, currying, and more. It has multiple-inheritance, type inference, and meta-programming. 

Groovy is very similar in syntax to Java so it is generally easy for Java developers to learn (Java code is generally valid Groovy code).  However, Groovy has many additional features and relaxed syntax rules: closures, dynamic typing, meta-programming (via metaClass), semicolons are optional, regex-support, operator overloading, GStrings, and more. Groovy is interpreted at runtime, but in Groovy 2.0 the ability to compile to byte-code and enforce type-checking were added to the language.

Praise for previous works:

If you're just getting to Java 8, I definitely recommend @adamldavis' book -- very concise and helpful. -Fred Jonsson

"bought both of your books (Modern Java & Modern Programming) and let me tell you, what a great value and extremely good content" - Rozzot

About the Author

Adam L. Davis
Adam L. Davis

Adam Davis makes software. He's spent many years developing in Java (since Java 1.2) and has enjoyed using Spring and Hibernate. Since 2006 he's been using Groovy and Grails in addition to Java to create SaaS web applications that help track finances for large institutions (among other things). Adam has a Masters and a Bachelors degree in Computer Science from Georgia Tech.

http://adamldavis.com

Table of Contents

  • Getting Groovy
    •  
      • About This Book
    • Software to Install
      • Java/Groovy
      • Others
      • Code on Github
    • Groovy 101
      • What is Groovy?
      • Compact Syntax
      • Dynamic Def
      • List and Map Definitions
      • Groovy GDK
      • Everything is an Object
      • Easy Properties
      • GString
      • Closures
      • A Better Switch
      • Meta-programming
      • Static Type Checking
      • Elvis Operator
      • Safe Dereference Operator
      • A Brief History
      • Summary
    • Tools
      • Console
      • Compilation
      • Shell
      • Documentation
    • GDK
      • Collections
      • IO
      • Ranges
      • Utilities
    • Coming from Java
      • Default Method Values
      • Equals, Hashcode, etc.
      • Regex Pattern Matching
      • Missing Java Syntax
      • Semi-colon Optional
      • Where are Generics?
      • Groovy Numbers
      • Boolean-resolution
      • Map Syntax
      • Summary
  • Advanced Groovy
    • Groovy Design Patterns
      • Strategy Pattern
      • Meta-programming
      • Method Missing
      • Delegation
    • DSLs
      • Delegate
      • Overriding Operators
      • Method-missing and Property-missing
    • Traits
      • Defining Traits
      • Using Traits
      • Summary
    • Functional Programming
      • Functions and Closures
      • Map/Filter/etc.
      • Immutability
      • Groovy Fluent GDK
      • Groovy Curry
      • Method Handles
      • Tail Recursion
      • Summary
    • Groovy GPars
      • Parallel Map Reduce
      • Actors
  • The Groovy Ecosystem
    • Groovy Awesomeness
      • Web and UI Frameworks
      • Cloud Computing Frameworks
      • Build Frameworks
      • Testing Frameworks/Code Analysis
      • Concurrency
      • Others
    • Gradle
      • Projects and Tasks
      • Plugins
      • Configuring a Task
      • Extra Configuration
      • Maven Dependencies
      • Gradle Properties
      • Multiproject builds
      • File Operations
      • Exploring
      • Summary
    • Grails
      • What is Grails?
      • Quick Overview of Grails
      • Plugins
      • REST in Grails
      • Short History of Grails
      • Testing
      • Cache Plugin
      • Grails Wrapper
      • Cloud
      • Groovy Mailgun
    • Spock
      • Introduction
      • A Simple Test
      • Mocking
      • Lists or Tables of Data
      • Expecting Exceptions
      • Conclusion
    • Ratpack
      • Script
      • Gradle
      • Ratpack Layout
      • Handlers
      • Rendering
      • JSON
      • Bindings
      • Blocking
      • Configuration
      • Testing
      • Summary
  • Appendixes
    • Java/Groovy
    • Resources
  • Notes

Causes Supported

Oxfam America

Right the Wrong
http://www.oxfamamerica.org

Oxfam America is a global organization working to right the wrongs of poverty, hunger, and injustice. We save lives, develop long-term solutions to poverty, and campaign for social change. As one of 17 members of the international Oxfam confederation, we work with people in more than 90 countries to create lasting solutions.

Oxfam America is a global organization working to right the wrongs of poverty, hunger, and injustice. We save lives, develop long-term solutions to poverty, and campaign for social change. As one of 17 members of the international Oxfam confederation, we work with people in more than 90 countries to create lasting solutions. Our vision: A just world without poverty. Our mission: To create lasting solutions to poverty, hunger, and social injustice.

The Leanpub 45-day 100% Happiness Guarantee

Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Write and Publish on Leanpub

Authors, publishers and universities use Leanpub to publish amazing in-progress and completed books and courses, just like this one. You can use Leanpub to write, publish and sell your book or course as well! Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks. Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. It really is that easy.

Learn more about writing on Leanpub