Vaadin 7 Cookbook

May 21, 2013

I finally have a chance to look at Vaadin version 7 now, which is already up to v7.0.6 (nice work team!). There is a wealth of information from Vaadin about the changes and migration path, but I'm skipping all that and jumping right to examples as an experiment. Thus, my first blog ever about a book.

I haven't always liked "cookbook" style technical books ("Python Cookbook" is a great one), but I'm enjoying Packt Pub's Vaadin 7 Cookbook a lot. It's not trying to be a replacement for the Book of Vaadin, which is still a required reference. Instead, it's a very easy-to-follow tour of things you're either going to do, or will want to do once you know you can.

When I say it's easy to follow, I mean the code examples are very concise and get to the point without becoming overwhelming. I could probably learn a lesson there in my own blog examples, heh. It helps that Vaadin applications are easy to construct, but it's still some nice writing to get a fully-working, useful example written so that it can be explained in small chunks and works on its own. Each "recipe" introduces some end goal, walks you through the code, and then has an explanation of why it works. The formula works well. Then links are included to the Vaadin API or Book of Vaadin for more information. The links alone makes this a great reference source.

As a fun example, the very last recipe in the book is, well, the opposite of the first web app we've all written (I don't want to give it away). The recipe very succinctly illustrates how easy it is to include Javascript code in your application. This was the first time I've seen that in Vaadin 7, and it's much easier than I expected. A somewhat larger example is the drag-and-drop uploader, which is something I think I'd be able to come up with eventually, but now I don't have to!

Overall, this is a great book of examples that cover a lot of common and not-so-common tasks in writing a Vaadin application. For the Vaadin newcomer, this book illustrates the power of the Vaadin framework very quickly. Reading it reminded me of how I felt when I first learned about Vaadin a thousand years ago. For the veteran developer, there will be things you haven't tried yet, especially if you're making the switch now from version 6 to 7.

If I have a complaint at all, it's that some of the downloaded examples are maven projects (so there's no setup to run), and others are just the source files. Still, it's pretty simple to change to an example directory and run "rm -rf $dir/* && cp -R . $dir/" where $dir is the package in an already-made project. This works for most of them -- don't forget to move .js files to the 'resources' dir in a maven project. So it's a very minor nit. Having all this example code in one place is easily worth buying the book.

Share this