CHAPTER 2Groovy Basics

Chapter 1 introduced you to Groovy, its relationship to Java, and where it differs. This chapter will delve into the Groovy language. The focus will be on language features commonly used to build Grails applications. First, you will learn about Groovy scripts, including compiling and running Groovy scripts using the command line, Groovy Shell, and Groovy Console. Then we will focus on specific aspects of the Groovy language: assertions, strings, methods, closures, collections, ranges, regular expressions, and operators.

Scripts

You will be using the Groovy language to build: domain objects, controllers, and services. But that isn't the only way to use Groovy. In addition to building classes, you can use Groovy as a scripting ...

Get Beginning Groovy and Grails: From Novice to Professional now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.