Software development

Tech Pick of the Week: Play 2.2

Topics
Play Framework, Scala, Software development, Tech Pick of the Week

Play Framework has been used at Futurice since 2010.  It was an interesting technology already at 1.X versions when it brought a bit of a Ruby on Rails-like approach to Java backend development.  With Play 2, things got even better with great tools for asynchronous processing and emphasis on Scala support.

We have used Play 2 in at least four projects now, ranging from a high load mobile website to REST backends that get their data from diverse sources:  In one case the data store is MongoDB, used with ReactiveMongo.  In another project we make SOAP calls to SharePoint and use the SAP Java Connector.  Experiences from these projects are positive, especially in the teams using Play 2 with Scala.

Play 2.2 was released a little over a week ago, and in my current project we started thinking whether it was the right time to take it into use.  My team mate Juho Karppinen decided to try it out and, after spending a couple of hours on it last Friday, reported that the 2.2 branch would be ready to be taken into use.

For an overview of the new features, a good starting point is the What's new in Play 2.2 page in Play documentation.  The main things for my current project are the unification of result types and the new way of composing actions, but the built in gzipping of responses is also a nice little addition that we had previously missed.

Framework or API evolution is great for future users of the framework.  For existing projects, it can be a double-edged sword: providing features that have been lacking in previous versions and fixing bugs, but also requiring migration work that takes time away from valuable features.

For our project team, Play 2.2 was quite a smooth minor release.  With the new action composition we would combine our handling of authentication, logging, and CORS differently if starting from scratch, but we weren’t forced to do a major refactoring of our existing code immediately.  We will probably refactor our code to use the new tools the next time we need to make changes in that area.  The very detailed post on Play 2.2 action composition by Marius Soutier is a great resource for digging deeper into the topic and was useful in our migration.