Groovy Recipes: Greasing the Wheels of Java Paperback – Feb 28 2008
Customers Who Bought This Item Also Bought
No Kindle device required. Download one of the Free Kindle apps to start reading Kindle books on your smartphone, tablet, and computer.
Getting the download link through email is temporarily not available. Please check back later.
To get the free app, enter your mobile phone number.
About the Author
Scott Davis is the Editor in Chief of aboutGroovy.com. He isalso an author and independent consultant. He is passionateabout open source solutions and agile development. He hasworked on a variety of Java platforms, from JEE to JSE to JME(sometimes all on the same project).He is the co-author of JBoss At Work (O'Reilly), and author ofGoogle Maps API (Pragmatic Bookshelf) and GIS for WebDevelopers: Adding Where to Your Web Applications(Pragmatic Bookshelf).
Most Helpful Customer Reviews on Amazon.com (beta)
I own and have studied, and liked, 4 other Groovy books, but since I am not using it full-time yet, I tend to forget just the stuff I would like to have at my fingertips just when I need it. Reading the other books is kind of like looking at a new car in the showroom: you see the features, but not much more. This book is like taking a test drive on a race course: you immediately experience the power of using it like it should be used.
The subtitle for this book could be: How to do incredibly useful things *immediately* with Groovy. As the author says in chapter 6, he's not a sys admin, but Groovy makes it almost enjoyable to do all the sys tasks a developer has to handle all the time.
I cannot recommend this book highly enough. Will it teach you Groovy from the beginning, will it teach you the internals? I don't know, all I do know is that each page tells you how to do something you need to do, how to do it quickly and easily, and it tells you in a way that clarifies a lot of what I have read in other books.
This is one of the most useful books I have ever read since K&R.
The book is driven by a series of insights rather than complete, formal coverage. I found this approach very useful to getting started and experimenting. The writing is clear, light-hearted, and relaxed, especially in the beginning.
Towards the end of the book, the explanations wane a bit. The sample code is more often given without an introduction, beyond the section header. I was less sure what was going on in some of these cases, as I had gotten accustomed to picking things up very quickly in the beginning. The explanations that followed these code bits were good enough, but I missed that sense of the author's energy from beginning to end of each section.
I don't understand at all why it's called Groovy Recipes. There aren't any. The examples illustrate very well the power of this tool, but I didn't see anything that amounts to, say, the Groovy way to mine a web page, create an IM interface, read mail, etc. If you are looking for code you can apply immediately to some series of problems, this isn't the one.
Groovy Recipes does what the title says: gives you recipes for how to get stuff done in Groovy. But that's only part of the value of this book. It also teaches how to become an idiomatic Groovy developer. And that's incredibly important. The classic book on C, the K&R book The C Programming Language, did 2 things for C. First and foremost, it taught developers about the c programming language. But the second more subtle thing it did was to teach developers how to be idiomatic C programmers. I can remember reading the book and marveling at the conciseness of the code, which had as much to do with the way the language was used as the language itself.
Anytime you learn a new language, you have 2 battles: first, learn the syntax (which is the easiest part -- it's just details of how familiar concepts are expressed in the new syntax). The second battle is the more important one: how to become an idiomatic programmer in that language. Developers new to a language tend to write new code just like code from their former language, using new syntax. Only when they've had time to steep in the better, more elegant ways of expressing yourself in a new language do they truly become proficient. That's what Groovy Recipes does for Groovy developers. It shows not just the syntax, but how to idiomatically use that syntax to become proficient with Groovy. Groovy is a much more powerful language than Java. While you can take a Java source file and rename it with a groovy extension and have it still work, you're writing Groovy code like a Java developer. After you've seen and used Groovy for a while, you start writing code like a Groovy developer. The Groovy Recipes book is two things: recipes for using Groovy to solve problems. But, more importantly, it teaches idiomatic Groovy programming, which is the long-term benefit of the book. It is an excellent book, well written and highly informative.
However, the part of the book that helped (more accurately, is helping) me get Groovy integrated into my projects at work is the information about "Java and Groovy Integration". The projects build on existing internal and external Java APIs; so the information here was very helpful in proving Groovy will not interfere with the current investment in Java.
This is definately put together as a reference book; flipping through the chapters and reading what looks interesting hasn't disappointed me yet.
Scott's approach to the book is very agile, in that, after a brief discussion of the Groovy language, it essentially answers lots of very specific questions regarding "How to..." in Groovy. Each section starts with a code snippet that is designed to be copied directly into your code, letting you quickly solve a problem (e.g. parsing XMl documents) and move on. The detail in these examples ensures that this book will remain useful for some time to come. Along with the toolset you get, these examples really demonstrate the power of the Groovy language and provide an excellent way to learn the language.
While perhaps not as all encompassing a primer on Groovy as GINA, Scott does a good job, in the early part of the book, presenting most of the language's features in sufficient depth that I am comfortable suggesting this as your first book on Groovy. And once the basics are covered, Scott goes on to present some excellent examples of how to use idiomatic Groovy to solve common programming problems, including file I/O, XML processing, Web Services, basic metaprogramming, and a nice introduction to Grails, the web framework built with Groovy. After the Grails intro, Scott presents some nice examples of how to use Grails in a similar manner to his treatment of Groovy.