Review : Play Framework Cookbook

2011-10-06 - Thomas Queste

Play!, the framework for the bored Java developers ! Very interesting and opinated framework. I didn't play with it a lot in the previous months, but the new book "Play Framework Cookbook" by Packt Publishing, released this summer was a good way to dig into the framework. The ebook was offered for free to people who wants to review it. No excuse.


The chapters are :

  • Basics of the Play Framework
  • Using Controllers
  • Leveraging Modules
  • Creating and Using APIs
  • Introduction to Writing Modules
  • Practical Module Examples
  • Running Into Production

Each subsection is divided in parts: "Getting ready", "How to do it", "How it works", "There's more", "See also". The most interesting part for me is the explanation of the internals, not the "tutorial" part. I have found practical information in nearly each of these.

The "There's more" parts are cools because it shows additionnal/alternate/better ways to think about what you read before. For example, here is an excerpt from this part from the chapter "Understanding bytecode enhancement":

Overriding toString() via annotation

Peter Hilton has written a very good article on how one can configure the output of the toString() method of an entity with the help of an annotation by using bytecode enhancement. You can check it out at http://www.lunatech-research.com/archives/2011/01/11/declarative-model-class-enhancement-play

A lot of content is about modules (dependencies, events...) with some examples (Solr, cache...). The idea is to complete what you may find online or in the official documentation.


I give a "B" to the book, as it is 1) easy to read and well written, 2) entertaining, 3) actionnable. The author, Alexander Reelsen, has done a very good work.

I learnt a lot, even as a beginner on the framework. Many of my questions were answered. The main benefit of the book is to complete the online documentation and going further on many topics. I really liked the given explanations, the additionnal references and that the framework's code was referenced (in the form: "See this class for more info").

What's missing ? Maybe a Scala chapter, but as the author wrote: "When I started writing this book, my Scala knowledge was far from competitive (and still is in many areas)".


Written by:

Thomas Queste