Play Framework Cookbook review

In a previous post I had mentioned that I would be soon reviewing the Play Framework Cookbook. So here it is-

Chapter-1 Basics of Play Framework

  • Concise coverage of basic features of the Play Framework. Though you must be using the Play Framework documentation for a more detailed information. The last few sections which explain- Extensions, Suspendable requests need a bit more explanation.
  • Good to have, as one can refresh the basic concepts.
Chapter-2 Using Controllers
  • Few advanced concepts on using controllers- like Authentication, caching, rendering pdfs, rendering json, RSS readers, custom validation annotations.
  • This is a kind of advanced stuff. Caching is explained in terms of the HTTP caching headers as well as one section on authentication using HTTP Digest authentication.
  • Examples shown use a Test Driven development approach (TDD) which is a good way to develop and test.
  • This was a heavy content for me to understand. I dont think the HTTP Digest authentication and the http caching details were required? The caching api provided by the Play framework is good enough for caching (and it even supports memcache).
  • I liked the section on authentication and authorization of users as well as the PDF generation.
Chapter-3 Making use of modules
  • Nice and concise overview of few plugins for play framework.
  • Covers dependency injection using Spring/Guice – I haven’t used dependency injection much, so just glanced over this section.
  • Security module- this is a better plugin than using Http Digest authentication and avoids the task of creating the whole authorization/authentication model. Author briefly covers the authentication as well as the authorization concepts.
  • Using CRUD with security – this uses both CRUD and Security modules. This is like an extension to the previously covered module.
  • Nice to see the author covering the MongoDB module – converting the existing sample application (provided with the book) to use mongodb. There is another section on storing the files in mongodb and avoiding the use of filesystem for this.
  • All of the sections requires one to go through the sample code given, because the code mentioned in the book are only the snippets and not fully working code. (this makes sense, as it helps to trim down the size of the book). Also one can refer to any of these sections as and when its required to use the listed modules.
  • I would have liked to see the Google App Engine module being discussed as well (may be it would have been good to explain any one dependency injection modules.
Chapter-4: Writing Mashups (Creating and using APIs)
  • One of my favorite areas in web development – Mashups. I really liked the twitter search example- explains a lot of concepts there. Got to know about Gson for converting between Java and JSON (finally something simpler to parse the json data in Java).
  • Another good usecase- managing different output formats.
  • The Google Map API integration example explains the client side only approach to fetch the data unlike twitter example which uses server to make requests to twitter api. Its good that both the approaches are depicted. I think using server to make such requests would be better.
  • Interesting chapter and one can think of infinitely many ideas for mashups.
Chapter-5 and Chapter-6: Building and using Modules
  • These chapters dealt in detail about the creating of modules (chapter-5) and also  using some of the existing modules (chapter-6)
  • This is a kind of in-depth explanation and may be its important as it will help to modularize and reuse certain components of the framework.
  • Though I havent gone in detail for these chapters as I am not so well versed/advanced user of Play Framework but this would be a good reference for anyone interested in writing modules.
Chapter-7- Running the Play application in Production
  • This is the point where most of us dont reach and even though we have something in production we really don’t automate lot of things. May be the situation doesnt require so much automation or we think its difficult. None the less this chapter explains the two Continuous integration tools which can be used with the Play! applications and explains how one can automate the tests using them.
  • Shows how one can monitor the application internally and identify the pain points or integrating with external monitoring tools
  • Also explains about the SSL implementations, Log4J configuration, setting up distributed environment, using different webservers.
  • This chapter covers few advanced stuff and may be useful when one has a production ready application.
Final thoughts about the book:
  • This book requires a solid knowledge about the play framework as it tackles the advanced application development related aspects
  • If you are looking for understanding Play framework then this book is a not for you.
  • This book can be used as a reference and may not be required to be read end-to-end.
  • One can pick up any topic and start reading and implementing the solution and there’s not much dependency between the chapters.
  • This is a really good example of how a cookbook can be written- Problem, Solution and why it works
 A cookbook is good, but I would like to see a book which one can use to learn the framework that way any beginner can take it up and start learning. May be a book exclusively on modules. A book on using Scala with Play!, lot of them are moving to alternate JVM languages so it can be a good book. Nonetheless Play Cookbook is a good reference for all developers using Play Framework.
Few formatting issues I would like to point:
  • It would be better if the new topic in each chapter would begin in a new page. A topic starting after the 3/4th of page doesnt look good.
  • The code formatting at few places is not good, places where the code lines wrap to the next line.
  • The alignment of the content could have been justified.

Leave a Reply