Reader small image

You're reading from  Groovy for Domain-Specific Languages, Second Edition

Product typeBook
Published inSep 2015
Reading LevelIntermediate
Publisher
ISBN-139781849695404
Edition1st Edition
Languages
Right arrow
Author (1)
Fergal Dearle
Fergal Dearle
author image
Fergal Dearle

Fergal is a seasoned software development professional with 23 years of experience in software product development across a wide variety of technologies. He is currently principal consultant with his own software development consulting company, Dearle Technologies Ltd., engaged in design, development, and architecture for new software products for client companies. In the past Fergal has worked in lead architect and developer roles for Candle Corporation on the OMEGAMON product which is now part of IBMs Tivoli product suite as development manager for the Unix implementations of Lotus 1-2-3. In the early 1990s Fergal lead the team at Glockenspiel that developed CommonView, the first object-oriented UI framework for Microsoft Windows. The team was awarded one of the first ever Jolt Productivity Awards by Dr Dobbs Journal.
Read more about Fergal Dearle

Right arrow

Introducing the Groovy language


In the following sections, we will cover some of the fundamental concepts and features of the Groovy language. A working knowledge of Java is assumed, so we will focus on what is different between the Groovy and Java languages.

The module structure

Groovy programs and scripts are generally stored in Groovy source files with the .groovy extension. The exception to this are the Unix "shebang" scripts described in Chapter 2, Groovy Quick Start. Unlike Java source files, which must always contain a class definition, Groovy source files can contain both class definitions and inline scripting. When we compile or run a Groovy script, Groovy generates a class object for each Groovy class that it encounters in the source. If the source file contains some scripting elements, it also generates a class object for these.

To see how this works, let's take an example script and compile it with the Groovy compiler. We can use the GVM tool we encountered in Chapter 2, Groovy...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Groovy for Domain-Specific Languages, Second Edition
Published in: Sep 2015Publisher: ISBN-13: 9781849695404

Author (1)

author image
Fergal Dearle

Fergal is a seasoned software development professional with 23 years of experience in software product development across a wide variety of technologies. He is currently principal consultant with his own software development consulting company, Dearle Technologies Ltd., engaged in design, development, and architecture for new software products for client companies. In the past Fergal has worked in lead architect and developer roles for Candle Corporation on the OMEGAMON product which is now part of IBMs Tivoli product suite as development manager for the Unix implementations of Lotus 1-2-3. In the early 1990s Fergal lead the team at Glockenspiel that developed CommonView, the first object-oriented UI framework for Microsoft Windows. The team was awarded one of the first ever Jolt Productivity Awards by Dr Dobbs Journal.
Read more about Fergal Dearle