Abstract

This first chapter introduces Groovy as a unique scripting language designed to augment the Java platform. It offers Java-like syntax, native support for Maps, and Lists, methods, classes, closures, and builders. With its dynamic weak typing and seamless access to the Java Applications Programming Interface (API), it is well suited to the development of many small- to medium-sized applications. Generally, scripting languages such as Groovy are more expressive and operate at higher levels of abstraction than systems programming languages such as Java. This often results in more rapid application development and higher programmer productivity. However, scripting languages serve a different purpose than their systems language counterparts. They are designed for "gluing" applications together rather than implementing complex data structures and algorithms. Therefore, to be useful, a scripting language must have access to a wide range of components. The Java compiler produces bytecodes that execute on the Java Virtual Machine (JVM). Groovy classes are binary compatible with Java. This means that the bytecodes produced by the Groovy compiler are the same as those produced by the Java compiler. Hence, Groovy is Java as far as the JVM is concerned. This means that Groovy is able to immediately exploit the various Java APIs such as JDBC for database development, and Swing for developing GUI applications.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call