Download e-book for kindle: Programming Groovy 2: Dynamic Productivity for the Java by Venkat Subramaniam

Java

By Venkat Subramaniam

ISBN-10: 1937785300

ISBN-13: 9781937785307

Groovy brings you the easiest of either worlds: a versatile, hugely efficient, agile, dynamic language that runs at the wealthy framework of the Java Platform. Groovy preserves the Java semantics and extends the JDK to provide you real dynamic language functions. Programming Groovy 2 can help you, the skilled Java developer, examine and benefit from the newest model of this wealthy dynamic language. You'll move from the fundamentals of Groovy to the most recent advances within the language, together with techniques for style checking, tail-call and memoization optimizations, assemble time metaprogramming, and fluent interfaces to create DSLs.

You don't need to go away the wealthy Java Platform to use Groovy. Groovy preserves Java's semantics and extends the JDK, so programming in Groovy appears like the Java language has been augmented; it's like operating with a lighter, extra based Java. If you're an skilled Java developer who desires to find out how Groovy works, you'll locate precisely what you wish during this book.

You'll begin with the basics of programming in Groovy and the way it really works with Java, after which you'll discover complex options similar to unit trying out with mock items, utilizing developers, operating with databases and XML, and developing DSLs. You'll grasp Groovy's strong but advanced run-time and compile-time metaprogramming features.

a lot has developed within the Groovy language because the e-book of the 1st version of Programming Groovy. Programming Groovy 2 can assist you examine and follow Groovy's new beneficial properties. growing DSLs is less complicated now, and Groovy's already-powerful metaprogramming amenities have enhanced much more. You'll see tips to paintings with closures, together with tail name optimization and memoization. The e-book additionally covers Groovy's new static compilation feature.

no matter if you're studying the fundamentals of the language or attracted to getting educated with the hot positive aspects, Programming Groovy 2 has you covered.

What You Need

To paintings at the examples within the publication you would like Groovy 2.0.5 and Java JDK five or better.

Show description

Read Online or Download Programming Groovy 2: Dynamic Productivity for the Java Developer PDF

Similar java books

New PDF release: Erotic Triangles: Sundanese Dance and Masculinity in West

In West Java, Indonesia, all it takes is a woman’s voice and a drum beat to make a guy wake up and dance. each day, males there—be they scholars, pedicab drivers, civil servants, or businessmen—breach traditional criteria of decorum and succumb to the rhythm at village ceremonies, weddings, political rallies, and nightclubs.

New PDF release: Java Unleashed

Every thing you want to grasp Java! Java is redefining the aptitude and gear of the realm extensive net. Java Unleasehed places the Java programming language at your fingertips by way of providing you with specialist suggestion on programming basics, embedding Java applets into your web content, and programming video games, multimedia, and animation.

Download PDF by Godfrey Nolan: Decompiling Java

Either Java and . web use the belief of a "virtual machine," or VM. And whereas VMs are invaluable for a few reasons, they undermine the protection of your resource code, simply because production should be reversed, or decompiled. Which makes this distinct publication tremendous worthwhile: you need to comprehend decompilation, to correctly safeguard your highbrow estate.

Shawn Bayern's JSTL in Action PDF

JSTL is a vital simplification of the Java internet platform. With JSTL, web page authors can now write dynamic pages utilizing commonplace HTML-like tags and an easy-to-learn expression language. JSTL is a regular from the Java group approach, and its expression language becomes a part of JSP 2. zero. JSTL in motion exhibits you ways to jot down wealthy, dynamic web content with out programming.

Extra info for Programming Groovy 2: Dynamic Productivity for the Java Developer

Example text

If we’re using frameworks like Hibernate, JPA, Seam, Spring, and so on, we’ll find Groovy’s support for annotations quite helpful. Download from Wow! com> report erratum • discuss Chapter 2. Groovy for Java Eyes • 38 The Groovy compiler does not treat the Java compilation-related annotations the same way the Java compiler does. For example, groovyc ignores @Override. Static Import Static import in Java helps import static methods of a class into our namespace so we can refer to them without specifying the class name.

We don’t have to do anything different if we plan to provide one single implementation for all the methods of a multimethod interface. Suppose we want to display the location of the mouse pointer as the mouse is clicked and moved around in our application. In Java, we have to implement a total of seven methods of the MouseListener and MouseMotionListener interfaces. Since our implementation for all these methods is the same, Groovy makes our life easy. addMouseMotionListener(displayMouseLocation as MouseMotionListener) In this code, we created the variable displayMouseLocation that refers to a block of code.

We can return multiple results from functions and assign them to multiple variables in one shot. Simply return an array and use comma-separated variables wrapped in parentheses on the left side of the assignment. In the next example, we have a function that splits a full name into first and last names. The split() function, as we’d expect, returns an array. We can assign the result of the splitName() function to a pair of variables: firstName and lastName. Groovy assigns the two values to the two variables, respectively.

Download PDF sample

Programming Groovy 2: Dynamic Productivity for the Java Developer by Venkat Subramaniam


by Steven
4.1

Rated 4.74 of 5 – based on 10 votes