Jump to content

Play Framework

From Alfawiki
Play Framework
Company typeOpen-source software framework
IndustrySoftware development
FoundedMay 2007; 19 years ago (2007-05)
FounderGuillaume Bort
Area served
Worldwide
ProductsWeb application framework
Websitewww.playframework.com

Play Framework is an open-source web application framework that implements the model–view–controller (MVC) design pattern. Developed primarily in Scala, it also accommodates other JVM languages such as Java. The framework boosts developer efficiency by leveraging principles like convention over configuration, enabling hot code reloading, and providing error feedback directly within the browser.

Support for Scala was introduced starting with version 1.1. With the release of version 2.0, the core system was fully rewritten in Scala, the build and deployment processes transitioned to SBT, and the template engine shifted from Apache Groovy to Scala-based templates.

History

Play Framework was initially developed by Guillaume Bort at Zengularity SA (previously known as Zenexity). Its earliest versions trace back to May 2007, with pre-release versions accessible via Zenexity’s website.

Version history
Version Date Notes
Template:Version
  1. REDIRECT Template:Date table sorting
||Initial source code was published on Launchpad; the complete 1.0 version was officially released in October 2009.
Template:Version
  1. REDIRECT Template:Date table sorting
||Transitioned from Launchpad to GitHub; replaced Apache MINA with JBoss Netty; incorporated Scala support; introduced native GlassFish container; added asynchronous web services library along with OAuth and HTTPS capabilities.
Template:Version
  1. REDIRECT Template:Date table sorting
||Implemented dependency management via Apache Ivy; enabled WebSocket functionality; integrated database migration tools (without rollback); changed default development database to H2.
Template:Version
  1. REDIRECT Template:Date table sorting
||Updated libraries including Netty and Hibernate; added support for multiple databases and customizable template naming conventions.
Template:Version
  1. REDIRECT Template:Date table sorting
||Added compatibility with Java 7 while discontinuing Java 6 support; introduced configurable SSL protocol options.
Template:Version
  1. REDIRECT Template:Date table sorting
||Upgraded to Hibernate 5.x; ended support for Java versions earlier than 1.8.
Template:Version
  1. REDIRECT Template:Date table sorting
||Ensured compatibility with Java 14; updated several libraries.
Template:Version
  1. REDIRECT Template:Date table sorting
||Added support for Java 17; dropped compatibility with Java versions below 11; updated Play scripts to Python 3.
Template:Version
  1. REDIRECT Template:Date table sorting
||Sadek Drobi joined Guillaume Bort in developing Play 2.0 alongside the launch of Typesafe Stack 2.0.
Template:Version
  1. REDIRECT Template:Date table sorting
||Upgraded to Scala 2.10; introduced modular architecture, a new JSON API, filters, and RequireJS integration.
Template:Version
  1. REDIRECT Template:Date table sorting
||Updated SBT to version 0.13; enhanced buffering, added gzip compression support, provided native packaging for OS X, Linux, Windows, and zip archives.
Template:Version
  1. REDIRECT Template:Date table sorting
||Launched Activator command-line tool; improved static asset management; supported Java 8 and Scala 2.11; boosted performance and enhanced web service features including Actors and WebSockets integration.
Template:Version
  1. REDIRECT Template:Date table sorting
||Introduced built-in dependency injection; allowed embedding Play within other applications; improved Java 8 compatibility; adopted HikariCP as the default connection pool; expanded testing APIs.
Template:Version
  1. REDIRECT Template:Date table sorting
||Shifted asynchronous IO and streaming to use Akka Streams; replaced custom functional types with standard Java 8 types such as CompletionStage; provided equivalent Java APIs for features previously exclusive to Scala, resulting in a performance increase of approximately 20%.
Template:Version
  1. REDIRECT Template:Date table sorting
||Adopted Akka HTTP as the default server backend with experimental HTTP/2 support; compatible with Scala 2.12; removed internal global state usage; introduced JSON Web Token format for cookies; enhanced security and configuration options.
Template:Version
  1. REDIRECT Template:Date table sorting
||Added support for Scala 2.13; integrated Caffeine cache implementation; updated HikariCP and Guice dependencies; improved form validation and file upload capabilities.
Template:Version
  1. REDIRECT Template:Date table sorting
||Enabled Java 11 compatibility; refreshed Akka and Jackson libraries; incorporated pre-seek sources functionality for range queries.
Template:Version
  1. REDIRECT Template:Date table sorting
||Introduced support for Scala 3, Java 17, and Java 21.
Template:Version
  1. REDIRECT Template:Date table sorting
||Replaced Akka with Apache Pekko as a result of licensing changes affecting Akka.


Motivation

The Play Framework draws its inspiration from ASP.NET MVC, Ruby on Rails, and Django, positioning itself within this category of web frameworks. Applications built with Play are developed using Scala or Java, providing a development experience that is less constrained by the traditional limitations of Java Enterprise Edition. By circumventing the restrictions imposed by Java EE, Play offers a more streamlined and straightforward development process compared to conventional Java-based platforms.

While earlier versions like Play 1.x allowed deployment as WAR archives on typical Java EE application servers, Play 2.x is architected to operate solely on embedded Akka HTTP or Netty web servers.

Key distinctions from Java frameworks

  • Stateless design: Play 2 fully embraces RESTful principles, eliminating the use of Java EE sessions per connection.
  • Built-in testing capabilities: Native support for JUnit and Selenium is included within the core.
  • Extensive API provision: Most essential components are available out-of-the-box.
  • Asynchronous I/O handling: Utilizing Akka HTTP, Play manages long-running requests asynchronously, a feature often absent in many Java EE frameworks that lack Servlet 3.0 asynchronous support.
  • Modular structure: Like Ruby on Rails and Django, Play facilitates modular development.
  • Embedded Scala integration: Play 2 is implemented in Scala and delivers both Scala and Java APIs that adhere to the idiomatic styles of each language, ensuring seamless interoperability.

Testing framework

Play supports testing frameworks tailored for both Scala and Java ecosystems. For Scala developers, it integrates with Scalatest and Specs2; for Java, it works with JUnit 4. Both languages benefit from integration with Selenium (software). Testing is executed and reports are generated through SBT. Additionally, code coverage analysis can be enabled using sbt plugins such as scoverage or jacoco4sbt.

In August 2011, Heroku announced native compatibility with Play applications on its cloud computing platform, building upon earlier module-based support for Play 1.0 on Google App Engine as well as documented compatibility with Amazon Web Services.

, Play Framework held the position as the most widely used Scala project on GitHub. By July 2015, it ranked third among popular Scala libraries on GitHub, with 21.3% of leading Scala projects adopting Play as their framework.

Organizations employing Play include notable names such as Coursera, HuffPost, Hootsuite, Janrain, LinkedIn, and Connectifier.

See also

Literature

  • Wayne Ellis (2010). Introducing the Play Framework.
  • Alexander Reelsen (2011). Play Framework Cookbook. Packt Publishing.
  • Peter Hilton, Erik Bakker, Francisco Canedo (2013). Play for Scala. Manning.
  • Andy Petrella (2013). Learning Play! Framework 2. Packt Publishing.
  • Nicolas Leroux, Sietse de Kaper (2014). Play for Java. Manning.
  • Julien Richard-Foy (2014). Play Framework Essentials. Packt Publishing.
  • Shiti Saxena (2015). Mastering Play Framework for Scala. Packt Publishing.
  • Alexander Reelsen, Giancarlo Inductivo (2015). Play Framework Cookbook, 2nd ed. Packt Publishing.
  • PremKumar Karunakaran (2020). Introducing Play Framework, 2nd ed. Apress.

External links