30-05-2012, 10:29 AM
Fluently Groovy
Groovy Tutorial.rtf (Size: 63.67 KB / Downloads: 28)
Java application development using Groovy's simple syntax
Andrew Glover (aglover[at]stelligent.com), President, Stelligent Incorporated
Summary: This tutorial is for Java™ developers unfamiliar with Groovy, who want a quick and easy introduction to the basics. Get started with Groovy's simplified variation of the Java syntax and learn about essential features like native collections, built-in regular expressions, and closures. Write your first Groovy class, and then see how easily you can use JUnit to test it. You'll walk away from this one-hour tutorial with a fully functioning Groovy development environment and the skills to use it. Best of all, you'll have learned first-hand how to use Groovy and Java code together in your everyday Java application development.
Before you start
Learn what to expect from this tutorial and how to get the most out of it.
About this tutorial
Groovy is a lot like Java 2.0, if someone set out to completely rewrite the Java language today. Rather than replacing Java, Groovy complements it, providing a simpler, slicker syntax where the type checking is done dynamically at runtime. You can use Groovy to write Java applications on the fly, to glue together Java modules, or even to extend existing Java applications — you can even use Groovy to unit test your Java code. And the beauty of it is, Groovy lets you do all these things faster — sometimes a lot faster — than you would if you were writing pure Java code.
In this tutorial, you'll get to know Groovy, a dynamic language that sits as comfortably on the Java platform as does the Java language itself.
Back to top
Objectives
This tutorial guides you step-by-step through the fundamental concepts of Groovy. You will learn about Groovy collections, Groovy classes, and, of course, the Groovy syntax. When you are done with this one-hour tutorial, you will understand the benefits of using Groovy with Java (and vice versa), and you'll be set to start using Groovy in your everyday Java development.
Back to top
Prerequisites
To get the most from this tutorial, you should be familiar with Java syntax and the basic concepts of object-oriented development on the Java platform.
Back to top
System requirements
To follow along and try out the code for this tutorial, you need a working installation of either
Sun's JDK 1.5.0_09 (or later); or
IBM developer kit for Java technology 1.5.0 SR3
In addition, this tutorial assumes you are using the Eclipse IDE. You do not need to have Groovy installed as the tutorial walks you through the Groovy Eclipse plug-in installation.
The recommended system configuration for this tutorial is as follows:
A system supporting either the Sun JDK 1.5.0_09 (or later) or the IBM JDK 1.5.0 SR3 with at least 500 MB of main memory
At least 20 MB of disk space to install the software components and examples covered
The instructions and examples in the tutorial are based on a Microsoft Windows operating system. All the tools covered in the tutorial also work on Linux and Unix systems.
Fluently Groovy
Java application development using Groovy's simple syntax
Andrew Glover (aglover[at]stelligent.com), President, Stelligent Incorporated
Summary: This tutorial is for Java™ developers unfamiliar with Groovy, who want a quick and easy introduction to the basics. Get started with Groovy's simplified variation of the Java syntax and learn about essential features like native collections, built-in regular expressions, and closures. Write your first Groovy class, and then see how easily you can use JUnit to test it. You'll walk away from this one-hour tutorial with a fully functioning Groovy development environment and the skills to use it. Best of all, you'll have learned first-hand how to use Groovy and Java code together in your everyday Java application development.
About Groovy
In this section you'll learn the basics of Groovy: what it is, how it relates to the Java language and the JVM, and some of the highlights of writing Groovy code.