Introduction to Groovy scripting language
As we are going to use Groovy scripts throughout this chapter, we should prepare in advance by familiarizing ourselves with the basics of Groovy. If you possess some knowledge about Groovy or have experience of working with it, you can skip reading this section.
What is Groovy?
Groovy is a dynamic programming language in which most of the program execution processes are done at runtime instead of compile time. Groovy can be categorized into the same family of scripting languages such as Ruby, Perl, or JavaScript. As we already know, learning a new language is a tedious activity because we need to learn the syntax, control structures, declarations, and so on for the new language. However, this is not true for Groovy if you already know the fundamentals of Java. Groovy uses Java-like bracket syntax and most Java code is syntactically valid in Groovy. Groovy scripts run on JVM similar to Java programs, hence we do not need to install and configure additional...