Play

Model-View-Controller (MVC) framework

Play is an open-source web application framework that is based on the MVC architectural pattern. The Presentation layer is kept separate from the Model layer. The Presentation layer is further split into a View and a Controller layer. The division of these layers helps to gain a clear division between responsibilities, better code readability and reuse in addition to easy maintenance. Play is a pure and full-stack web framework which runs on the Java Virtual Machine (JVM). Play is built using Scala and is a highly-reactive web framework that works efficiently in a distributed environment.

Everybody wants to Play

Applications developed with Play are stateless, meaning that no state can be stored on the server to cover multi-request workflows. To counter this, Play has a built-in non-blocking JBoss Netty server which has an event-based architecture through which you can serve as many users relative to the number of threads it can deal with. Also, Play can declare a process as asynchronous, wherein the server can choose when to process it and when to come back. As a result, it is easy and inexpensive to make remote calls in parallel, enabling you to support concurrent connections. This results in the high performance of applications in a service-oriented architecture. Almost everything in Play is pluggable, configurable and customizable which makes it suitable for large-scale applications. Another interesting feature is hot reloading for Java code, templates, and config changes which allow you to iterate faster – being able to see modifications immediately speeds up your development process significantly. Play has superb error handling capabilities as it displays the error message, the file path, and the relevant code snippet in the browser, making your debugging process a breeze. Also, Play facilitates a high level of type-checking in which errors can be found early on during development.

Play the next level

As Play is a full-stack framework, it has several helpers for testing purposes which makes it quite useful for test-driven development. Functional end-to-end testing can be performed comprehensively using FluentLenium which is the API for Selenium in the Play framework. Play enables the ‘code once, deploy everywhere’ paradigm and helps you deploy your application to cloud platforms such as Heroku. With the latest version of Play, you can write compiled assets such as CoffeeScript files for JavaScript, or LESS CSS for CSS. Server-Sent Events (SSE) which enable the ability to push data to the browsers and using WebSockets to send and receive data from the browser are part of the latest HTML5 protocols well supported by Play. Play employs the latest and modern development practices, making it a framework-of-choice for developing high fidelity applications.

Books to Consider

comments powered by Disqus