rank trend

Groovy Recipes: Greasing the Wheels of Java (Pragmatic Programmers)

by Scott Davis
Released 2008-03-11
Read articles about Ruby
Buy it from AmazonNew for $20.48

19 Reviews

Sort by: Most Helpful ▲ Date Rating

5 stars outstanding and indispensable

2008-02-27     11 of 11 found this review helpful

I absolutely love this book. I have no idea how it would read for a newbie, but as a developer well-versed in Java and very familiar with Groovy, this is an incredibly empowering book.

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.


5 stars The K&R of the Groovy World

2008-04-29     7 of 7 found this review helpful

(Disclaimer: I know Scott Davis, but don't hold that against him)
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.

5 stars Great reference book

2008-04-29     5 of 5 found this review helpful

For me, the best part of the whole book was Chapter 3: "New to Groovy". The "New to Groovy" chapter essential lists out all the Groovy answers to "why Java can be painful and how Groovy soothes". I liked the very short "here's how you do X in Groovy" format - and any Java developer immediately can see the benefits to adding Groovy to their development arsenal.

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.

5 stars A great resource, but misleading title.

2008-05-11     4 of 4 found this review helpful

I got this book after hearing the author speak at JavaOne. His talk covers the content of the first chapter along with a few other items, but I didn't mind. It was quite helpful to read through the points and examples he made and try them out at my own pace.

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.

5 stars Indispensible source of Groovy tips and techniques

2008-01-16     4 of 5 found this review helpful

Learning the syntax of a language is one thing; learning how to use it productively is something else entirely. While nothing can replace Dierk Koenig et al's Groovy in Action, that book is only the first step to becoming a productive Groovy developer. Scott Davis here provides short, practical examples of how to incorporate Groovy into your everyday Java work in a wide variety of ways.

Like most recipes books, the book works best for me as a reference. Whenever I'm working on a Groovy application and need to know the "grooviest" way to accomplish a particular task, I can quickly find a sample here and use it.

One of the best features of Groovy is that it provides a very easy learning curve for Java developers. The samples in this book show you how to gradually add Groovy snippets to existing Java systems, as well as how to build those systems in a Groovy fashion from the start. When you add in Scott's customary easy-going style, the result is a book that I expect to be a major seller in the community for years to come.

5 stars An agile reference for agile learning...

2008-03-08     3 of 3 found this review helpful

Disclosure: I was a technical reviewer of this book.

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.

Highly recommended!

5 stars Like having a well-trained team of Groovy ninjas ready to take on any task

2008-02-24     2 of 2 found this review helpful

Scott has clearly assembled *the* go-to guide for turning Groovy into every Java developer's perfect utility knife. Whether you need to quickly parse an Atom feed, serve up an Excel spreadsheet from your Grails app, or create a tarball on the fly, this book will show you how. In true Groovy style, Scott does away with all unnecessary ceremony and gets right down to business. In almost every section, the very first thing you see is code - the recipe for solving to the problem at hand - and if you want to stick around for the clear and informative explanation, well, that's strictly optional.

5 stars An Enjoyable Way to Learn Groovy

2008-02-09     2 of 4 found this review helpful

The Good: I really like the style of this book and that it shows you how to get things done quickly with code samples. It's very no-nonsense in the fact that it contains a lot of code and howtos. I really like Scott's writing style and found this book to be a real page-turner. This may have something to do with my eagerness to learn Groovy more than anything. The most refreshing part about this book is how up-to-date it is. Because it's a Beta, it seems to contain the most up-to-date information on Groovy and Grails. After reading Getting Started with Grails and working with it for a couple weeks, the first Grails chapter seemed a little basic - but that's likely because I've figured out how to mix all those recipes already. The Grails and Web Services chapter definitely has some interesting content, but I've rarely had a need to implement these recipes in a real-world environment. I'd rather see recipes on testing the UI (with the WebTest plugin) and how to use GWT and Flex with Grails. If SOUIs are the way of the feature, this is a must.

The Bad: Not much information on testing with GroovyTestCase, mock objects or implementing Security. If one of Groovy's sweet spots is testing, why isn't there more coverage on this topic? The Java and Groovy integration chapter is especially good, but there's very limited information on Ant and Maven. It's likely the websites provide sufficient documentation, but the Maven section only fills 5 lines on an otherwise blank page. The biggest problem I have with this book is I really like the recipes writing style and would love to see more tips and tricks. At 250 pages, I was able to finish this book with pleasure in a few days.

5 stars Great book for getting into Groovy

2008-05-23     1 of 1 found this review helpful

Groovy Recipes is an excellent introductory book into Groovy programming. The first few chapters give clear instructions for learning how to use Groovy. The remaining chapters give clear instructions for using some of Groovy's cool features: using Groovy with Java, Grails programming, metaprogramming, working with XML, File manipulation, and web services).
Much akin to the fun and energetic manner that Davis speaks in his presentations he writes Groovy Recipes.
If you haven't heard him speak(and even if you have), do a quick Google Video search for Scott Davis Groovy and you'll find a presentation or two of his. I recommend them.
One technique that I found especially useful is how Davis compared performing a simple task in the Java world, and then showed how it could be done in the Groovy world. Of course, it's easier in the groovy world for all the examples. It's nice to see areas where we can take advantage of Groovy's strengths.
Groovy Recipes has enough content to sit on an experienced Groovy developer's book shelf, but the more novice Groovy people will find more value in Groovy Recipes.

3 stars Some nice Recipes

2008-05-19     1 of 6 found this review helpful

It is a nice little book to have by your computer, if you are working with Groovy. I give this book 3 star review because this could have done without first 5 chapters. I think Groovy is a great language, and in my humble opinion it is more useful to a Java programmer, then Ruby, however the quality of Ruby books is far superior to books available in Groovy.

5 stars Groovy Baby Very Groovy!!

2008-05-09     1 of 1 found this review helpful

'Groovy Recipes: Greasing the Wheels of Java' is a typical Pragmatic release in that it is written well, free of bells and whistles, and jam full of relevant and useful information. There is 250+ pages of information here on how to use and implement Groovy, the wonderful Java addition that makes programming easier and more exciting for any and all developers!

Content is spread over 12 chapters:

01. Intro
02. Getting Started
03. New to Groovy
04. Java + Groovy
05. Command Line Groovy
06. File Tricks
07. XML Parsing
08. Writing XML
09. Web Services
10. Metaprogramming
11. Grails
12. Grails + Web Services

As can be seen by the TOC, this is a book for programmers of today living in a networked world. The focus is on writing efficient, good code that is fast and useful. This book is extremely beneficial to any and all Groovy developers that want to learn better and faster this wonderful technology.

***** RECOMMENDED

5 stars Incredible Groovy Reference

2008-04-07     1 of 1 found this review helpful

For those of you who haven't heard of Groovy, Groovy is a scripting language that is built on top of Java. Since it is written on top of Java, a Java developer can pick up pick Groovy in a snap.

About a year ago, I was able to hear Scott Davis give an incredible talk on Groovy. When I found out that he was coming out with a book on Groovy, I couldn't wait to read it. His book covers the Groovy language basics in a clear and concise manner with plenty of examples that you can use in your own code to solve a problem. In addition to providing every day solutions to common problems, this book has one of the best explanations I have seen of how Groovy handles private variables. After covering the basics, his book includes loads of useful "Groovy Recipes" such as how to compile your Java Classes with Groovy classes, how to execute commands easily on the command line, other useful file tricks, and too many other useful recipes to mention. I learned a great deal of what I can do with Groovy by reading this book.

This book is a must have for any Groovy developer.

5 stars Concise and right to the point

2008-03-24     1 of 1 found this review helpful

If you need a quick reference on how to do common things in Groovy, get this book. This is like "Quick Reference Handbook" (QRH) that each air crew of any major airline has.

5 stars Must Have Reference Book

2010-02-01     0 of 0 found this review helpful

Whether you're new to Groovy or you're an experienced Groovy programmer, Groovy Recipes, is a must have reference book. Groovy Recipes, is good at giving a basic explanation on Groovy core concepts. But, its real strength is in providing a plethora of examples, that keep you coming back to this book, again and again, to learn the simple elegance of writing Groovy code.

Even if you're an experienced Java or Groovy programmer, you'll want this book in your programming tool box. I often reference Chapters 6,7 and 8, "File Tricks," "Parsing XML" and "Writing XML," respectively.

The last two chapters of the book, which cover Grails, are OK, if you want a general understanding of what Grails is and how to use it. However, if Grails is your greater interest, there are better books that you will want to have on your shelf to reference (e.g. Groovy and Grails Recipes and The Definitive Guide to Grails).

Bottom line, if Groovy is your primary programming language, this is an excellent book to have in your arsenal.

5 stars An Indispensible Go-To Book

2009-09-11     0 of 0 found this review helpful

I have many dozens of software development books. Most are good for a one-time read to wrap my mind around a subject, but once read are on their way to degrading into dust like those described in H.G. Wells' "The Time Machine."

However, a few (sadly, too few) rise into a superior category of books. These are my "Go-To" books; books I reference almost daily until all the details presented are hardwired into my gray matter. This is one such book.

In this book, Scott presents many useful recipes for using Groovy. He understands what a Java developer is used to doing and frequently shows the Groovy examples in contrast to the Java code.

Just today, over lunch I picked it up again to review the nuggets about calling web services. In just a few minutes, and a surprisingly few lines of Groovy code, I had a working application to produce an offline snapshot of some useful documentation.

Sure, that's a testament to Groovy as much as to Scott. Yet it is his concise, easy-to-read style and collection of recipes that made the task much simpler for me than it would have been otherwise.

Every time I reference this book the experience is the same ... a real pleasure. Thanks Scott.

Jack

5 stars No nonsense explanations, good clear layout

2009-08-09     0 of 0 found this review helpful

Needed to learn Groovy basics very quickly, particularly XML processing. Groovy is the scripting language within the Web Services testing product SoapUI that I'm using. I found it an excellent quick-start to the language, and a particularly good XML chapter luckily for me. Its much better than it's series companion "Programming Groovy: Dynamic Productivity for the Java Developer" in my opinion.

Personally I'm not a great believer in the language (still has much of the complexity of Java, and adds the syntactical obviscation of something like Unix shell, I dread to think what sort of code a full-on nerd could write...). But this book held my interest and (almost) converted me to Groovy (eg, file handling and exception handling is truly cool compared to Java)

May good technical authors keep writing books like this to keep me ahead of the curve.

5 stars Get ready to put the pedal to the medal

2009-06-28     0 of 0 found this review helpful

When I first heard about Groovy, I was very skeptical... That is until I was given this book by a colleague. This book is jam packed with awesome time saving examples! The section on File I/O and XML saved me tons of hours on a few of my Java projects I was working on at the time. If you want to save time and lines of code, get this Book! If you are new to Groovy, I would recommend combining this with Programming Groovy: Dynamic Productivity for the Java Developer (Pragmatic Programmers)

5 stars Want to pick up Groovy quick? Get this.

2008-05-09     0 of 0 found this review helpful

So you're in a hurry to pick up Groovy, and you're not a big fan of books that while informative, fill you with more language theory than useful knowledge. This buck, while around 240 pages in length, manages to take you from Hello World! to Web Service programming and Grails rapid development in a short period. If you know Java, you'll feel right at home with Groovy, and will feel good about your skills after you're done reading this book.

5 stars A top pick for any Java library.

2008-05-08     0 of 0 found this review helpful

Computer libraries catering to busy Java professionals will find GROOVY RECIPES a winner, offering quick, at-a-glance solutions to everyday, common Java issues. Each 'recipe' begins with a quick-start code example followed by a clear and easy explanation. The idea is to get up to speed quickly, not become bogged down in theory and detail. Arrays, Maps, Grails and more applications receive quick, easy referencing under Scott Davis hand, making GROOVY RECIPES a top pick for any Java library.

Diane C. Donovan
California Bookwatch

Buy it from AmazonNew for $20.48