Tag Archives: review

Ohh my GINA (Groovy in Action)

Groovy in Action
I have already noticed a couple of GINA‘s reviews out there, but I still thought to post mine. Yes, I know this one can be considered a bit more subjective than others having in mind that lately I played more and more with Groovy, I have implemented support for annotations in Groovy and already released the 1.0 of Test’N’Groove (integration of TestNG and Groovy — but I will write more about it some other time).

During the last months I have been reading a lot about different programming languages: Common LISP, Python, Scala, etc. So, I would say that my brain was in a new programming language mood. And, even if some may hate me for this, I would say that writing a book about a PL is an easy job. Depending on the target you set and on your experience and knowledge, you pick the subjects you are best in and develop around those. The hard part is to make your book the Bible of that programming language, the first book people will be looking for when starting to learn that language. And even harder is to make it attractive and fun and entertaining for your readers. At this point I must confess that I read GINA in less than 3 days, even if it has more than 600 pages (oke, I confess I haven’t read it all, but for sure more than 80% of it). And not only that I got that feeling that it is so fun that I cannot stop myself, but I think it fulfills all the characteristics of great and absolutely enjoyable PL book.

For the beginning here is a short description of Groovy’s power:

Some languages may have a few more features than Groovy. Some languages may claim to integrate better with Java. None can currently touch Groovy when you consider both aspects together: Nothing provides a better combination of Java friendliness ”and” a complete range of modern language features.

The Groovy in Action authors, many of them part of the Groovy specification and development team, will walk you through almost all interesting features of Groovy (closures, builders, dynamic object orientation, Groovy Standard Library) — and I still believe they haven’t left many out :-). The reader is introduced step by step in the world of Groovy, getting more and more knowledge by every page. The book doesn’t stop at theoretical aspects of Groovy language, but it is also presenting the reader with pragmatic aspects as working with databases, working with XML, integration with Spring and integration in Mustang, performing Windows specific tasks. The book has also a special place for Grails one of the most important (if not the most) framework based on Groovy.

Finally, without any fear, I would say that Groovy in Action is not just a language guide, but represents the clear, readable and enjoyable specification of Groovy (and you should definitely read it and start playing with Groovy [blink/] ).

Advertisement

2 Comments

Filed under personalog, technolog

The definitive guide to Grails

You may say that Grails is just yet another web framework, but this would definitely not be fair. Even if it is a quite young web framework – being now at version 0.4.1 – Grails has learnt a lot from existing Java web frameworks but also from frameworks outside Java space like RoR , Django, etc. I would even say that the fact that Grails is based on Groovy makes it unique to the Java space and I think it may prove its usability quite immediate. These were my reasons that made me start reading the book.

Grails forms just one framework that is driving the movement toward dynamic language-based frameworks. In this sense, anyone who is interested in the dynamic language field, whether you are from a Perl, Ruby, or Python background, would gain something from reading this book, if just to acquire insight into what the alternatives are.
(Graeme Rocher)

Graeme Rocher, the Grails project lead, took the opportunity to write The Definitive Guide to Grails, so that everybody can benefit of his knowledge in developing apps and become an expert in Grails.

As the book starts, you are already told about the rationale behind Grails:

Grails definitely has an ambitious name for being the Holy Grails all application developers have sought so far. But more than having mere ambition, Grails fulfills its promises by letting you be more productive than you could have ever thought.
(Guillaume Laforge)

and a bit further:

The goal of Grails was to go beyond what other languages and their associated frameworks could offer in the web application space. Grails aimed to do the following:

  • Integrate tightly with the Java platform
  • Be simple on the surface but retain flexibility to access the powerfull underlying Java frameworks and features
  • Learn from the mistakes already made on the mature Java platform

However, it is not my intention to take away your pleasure to read the book, but just to point out a couple of things that kept up my interest while scanning it.

The book gets you started with Grails even from the first chapter where you set up your environment and the example application. It is impressive how quick things are working:

  1. downloaded the binary distribution and unarchived it in a directory
  2. configured the environment (just an environment variable)
  3. run grails run-app
  4. launch your brower: http://localhost:8080/bookmarks

All these steps and more details about Grails project, project organization are presented in the first chapters of the book. These are meant to make you feel comfortable creating new projects and handling the command line tools, but also to give you a quick introduction to Groovy.

Then the author delves into each Grails details walking you through building the domain and its persistence using GORM, creating web controllers, data binding and control flow, writing Groovy Server Pages using Groovy scriptlets and the extensive set of Grails tags.

One point about Grails controllers that I want to mention its the framework capability to define action interceptors, something that other web frameworks have proved to be a nice approach (see WebWork). Grails benefits of a large number of smart tags, some of them making usage of Ajax very easily. The Chapter 9 talks extensively about this, introducing the reader to before and after call interception, event handling, remote linking, applying effects with the help of sciptaculous JS library.

Aside of detailed each Grails Dynamic Tags, Chapter 8 is presenting the usefulness and usage of layouts and templates talking also about Layout-by-Convention.

Another thing I liked about Grails is the pagination tag, this being introduce in the same Chapter 8: Groovy Server Pages.

The last two chapters of the book are talking about more advanced topics like jobs scheduling, server-side Java integration, Hibernate, Spring, Acegi usage.

The whole book walks you through an interesting and nice app that will make things even easier to understand. All in all, I would say that The Definitive Guide to Grails was a very nice reading and I hope others will find it the same.

Leave a comment

Filed under personalog, technolog

JUnit in your pocket

There are almost 2 weeks from the last post, but it seems that this end of year will be a very busy one, so I will have little time to write. I hope I’ll be back more active on the next year.
Now, getting away from this type of excuses and back to the topic.
Thanks to JavaRanch I had the opportunity to read the last Kent Beck’s book on JUnit: JUnit – Pocket Guide.
As the name states, it is indeed a pocket guide: 77 pages, from which almost 20 are about JUnit usage inside IDEs (if the editor would cut these full of images pages too and reduce a little bit the format, the book would enter your pocket without any problems [smile/]). Otherwise, the book contains a little of everything: history, reasoning behind creating and using JUnit, a short presentation of the framework architecture and implementation, reduced JUnit API comments and very few examples. Some short comments on possible extensions and that’s all. I think everything inside is in pocket suited format.
Concluding, I would say that JUnit – Pocket Guide is an (very) entry level reading for those wanting to have the first contact with JUnit. More infos are to be found on the JUnit site and other books.
Next reading: JUnit Recipes a book recommended everywhere and with great reviews.
Update: in the pocket review above I’ve forgot to pass the idea I loved the most:

[…]However, if I’m working by myself, I find it helpful to leave the last test broken at the end of the day. When I arrive in the morning, I know just what to do to get started: fix that test. That’s usually enough to get me started on my day

1 Comment

Filed under Uncategorized