This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages)(Learn how and when to remove this template message)
|Developer(s)||Lightbend, Zengularity and the community|
2.6.0 / June 23, 2017
|Written in||Scala (1.0 was written in Java)|
|Type||Web application framework|
|License||Apache 2 License|
Play is an open source web application framework, written in Scala and also usable from other programing languages that are compiled to Bytecode, e.g. Java (Play includes a Java API in more recent versions), which follows the model–view–controller (MVC) architectural pattern. It aims to optimize developer productivity by using convention over configuration, hot code reloading and display of errors in the browser.
Support for the Scala programming language has been available since version 1.1 of the framework. In version 2.0, the framework core was rewritten in Scala. Build and deployment was migrated to SBT, and templates use Scala instead of Groovy.
Versions above 2.5 requires the Java 8 JVM.
Play was created by software developer Guillaume Bort, while working at Zengularity SA (formerly Zenexity). Although the early releases are no longer available online, there is evidence of Play existing as far back as May 2007. In 2007 pre-release versions of the project were available to download from Zenexity's website.
Play 1.1 was released in November 2010 after a move from Launchpad to GitHub. It included a migration from Apache MINA to JBoss Netty, Scala support, native GlassFish container, an asynchronous web services library, OAuth support, HTTPS support and other features.
Play 1.2 was released in April 2011. It included dependency management with Apache Ivy, support for WebSocket, integrated database migration (reversion was not implemented), a switch to the H2 database as the default development database and other features.
Play 2.1 was released on February 6, 2013, upgraded to Scala 2.10 and introduced, among other new features, modularization, a new JSON API, filters and RequireJS support.
Play 2.2 was released on September 20, 2013. Upgraded support for SBT to 0.13, better support for buffering, built in support for gzip and new
dist tasks with support for native packaging on several platforms such as OS X (DMG), Linux (RPM, DEB), and Windows (MSI) as well as zip files.
Play 2.3 was released on May 30, 2014, introducing the Activator command, better tooling for static assets, support for Java 8 and Scala 2.11, better performance, Web Service enhancement and support to integrate Actors and Web Sockets.
Play 2.4 was released on May 26, 2015 with Dependency injection out of the box, the possibility to embed Play inside other applications, improved Java 8 support, HikariCP as the default connection pool and better testing APIs.
Play 2.5 was released March 29, 2016 and switched from Iteratees to Akka Streams for all asynchronous IO and streaming, replaced custom functional types with Java 8 types (such as
Optional), introduced equivalent Java APIs for features that previously only existing in the Scala API, such as implementing filters and custom body parsers and with a 20% performance increase.
Play is heavily inspired by ASP.NET MVC, Ruby on Rails and Django and is similar to this family of frameworks. Play web applications can be written in Scala or Java, in an environment that may be less Java Enterprise Edition-centric. Play uses no Java EE constraints. This can make Play simpler to develop compared to other Java-centric platforms.
Although Play applications are designed to be run using the built-in Netty or Akka-HTTP web server, they can also be packaged as WAR files to be distributed to standard Java EE application servers.
Major differences from Java frameworks
- Stateless: Play 2 is fully RESTful – there is no Java EE session per connection.
- Integrated unit testing: JUnit and Selenium support is included in the core.
- API comes with most required elements built-in.
- Asynchronous I/O: due to using JBoss Netty as its web server, Play can service long requests asynchronously rather than tying up HTTP threads doing business logic like Java EE frameworks that don't use the asynchronous support offered by Servlet 3.0.
- Modular architecture: like Ruby on Rails and Django, Play comes with the concept of modules.
- Native Scala support: Play 2 uses Scala internally, but also exposes both a Scala API, and a Java API that is deliberately slightly different to fit in with Java conventions, and Play is completely interoperable with Java.
Play 2.5.x makes use of several popular Java libraries:
- Netty or Akka-HTTP for the web server
- Akka Streams for all asynchronous IO and streaming
- No required ORM, but Anorm (Scala), Slick (Scala) and Ebean (Java) are included for database access
- Twirl (Scala) as the template engine
- Built in hot-reloading
- sbt as the build tool and for dependency management
The following functionality is present in the core:
- a clean, RESTful framework
- CRUD: a module to simplify editing of model objects
- Secure: a module to enable simple user authentication
- a validation framework based on annotations
- JSON and XML parsers and marshallers
- a persistence layer based on JPA
- an embedded database for quick deployment/testing purposes
- a full embedded testing framework
- an automatic file uploads functionality
- multi-environment configuration awareness
- a modular architecture, which enables bringing new features in the core easily
- OpenID and web services clients
Play provides integration with test frameworks for unit testing and functional testing for both Scala and Java applications. For Scala, integrations with Scalatest and Specs2 are provided out-of-the-box and, for Java, there is integration with JUnit 4. For both languages, there is also integration with Selenium (software). SBT is used to run the tests and also to generate reports. It is also possible to use code coverage tools by using sbt plugins such as scoverage or jacoco4sbt.
The mailing list for the project has over 13,000 subscribers. It is used in various projects such as local governments, company intranets, mobile web sites and Open Source projects.
As of October 2013[update], the Play Framework is the most popular Scala project on GitHub. In July 2015, Play was the 3rd most popular Scala library in Github, based on 64,562 Libraries. 21.3% of the top Scala projects used Play as their framework of choice.
Some notable public websites using Play:
- LinkedIn, the world's largest professional network
- Coursera, a website for online learning
- Lightbend, corporate website for Scala company founded by Martin Odersky
- LendUp, online alternative payday lending company focused on serving the US unbanked
- http://gendi.fr/, GENDI, a GS1 member
- http://jobs.siliconsentier.org/, jobs board of Silicon Sentier
- http://www.seine-et-marne.fr/, General council website of Seine-et-Marne, France.
- http://live.gilt.com Live shopping updates featuring Play's Realtime Web features, more details on their use of Play on Gilt's technology blog
- Sync Video, service for watching online videos in sync
- Prenser, news media network
- PeachDish, food e-commerce company
- Webservice First, a customer support and ticketing system (based on play 1.2.7)
- Whenvisited, fundraising platform
- Joysite, a website for creating easily editable websites with custom templates support (Launched in 2011 based on Play 1.1).
- Funraise, a non-profit fundraising platform (based on play 2.5.x)
- Eduparna, school search and parent forum
- SkySignature, online digital signature service
- Samsung Artik, Samsung IoT platform
- krispii, an online learning environment (launched in 2016 using play 2.4.x)
In December 2010, the first e-book for the Play framework was released. This was subsequently also published in hard copy. In August 2011, a second book was released, covering more complex and modern features.
In August 2011, Heroku announced native support for Play applications on its cloud computing platform. This follows module-based support for Play 1.0 (but not Play 2.x) on Google App Engine, and documented support on Amazon Web Services.
- Peter Hilton; Erik Bakker & Francisco Canedo (2013). Play for Scala. Manning. ISBN 9781617290794.
- Andy Petrella (2013). Learning Play! Framework 2. Packt Publishing. ISBN 978-1-78216-012-0.
- Nicolas Leroux; Sietse de Kaper (2014). Play for Java. Manning. ISBN 1617290904.
- Julien Richard-Foy (2014). Play Framework Essentials. Packt Publishing. ISBN 1783982403.
- Shiti Saxena (2015). Mastering Play Framework for Scala. Packt Publishing. ISBN 1783983809.
- Alexander Reelsen; Giancarlo Inductivo (2015). Play Framework Cookbook (2nd ed.). Packt Publishing. ISBN 1783982403.
- Play Team (2017-06-23). "Play changelog".
- Playing with Play Framework for Java
- Nicolas Leroux at Devoxx
- guillaume bort ★ software designer
- play-framework | Google Group
- ~play-developers/play/1.0 : revision 1
- Play framework - downloads
- Play 1.1 -- Release notes
- Community Contributed Extensions
- Play 1.2 -- Release notes
- Play 2.0 -- Philosophy
- Play! Framework Usability
- Play Framework on JBoss AS 7
- Play framework and async I/O
- Play's Google Group
- "GitHub: Search stars>1". Retrieved 5 October 2013.
- "The Top 100 Scala Libraries in 2015 – Based on 64,562 GitHub Libraries>1". Retrieved 19 July 2015.
- Introducing the Play! Framework
- Play Framework Cookbook
- Play! on Heroku
- Java development 2.0: Play-ing with Amazon RDS
- Play 2 Framework on Jelastic