Play Framework is an
open-source
Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use the source code, design documents, or content of the product. The open-source model is a decentralized sof ...
web application framework
A web framework (WF) or web application framework (WAF) is a software framework that is designed to support the development of web applications including web services, web resources, and web APIs. Web frameworks provide a standard way to build and ...
which follows the
model–view–controller
Model–view–controller (MVC) is a software architectural pattern commonly used for developing user interfaces that divide the related program logic into three interconnected elements. This is done to separate internal representations of infor ...
(MVC)
architectural pattern
An architectural pattern is a general, reusable solution to a commonly occurring problem in software architecture within a given context. The architectural patterns address various issues in software engineering, such as computer hardware perfor ...
. It is written in
Scala and usable from other programming languages that are compiled to
JVM
A Java virtual machine (JVM) is a virtual machine that enables a computer to run Java programs as well as programs written in other languages that are also compiled to Java bytecode. The JVM is detailed by a specification that formally describes ...
bytecode
Bytecode (also called portable code or p-code) is a form of instruction set designed for efficient execution by a software interpreter. Unlike human-readable source code, bytecodes are compact numeric codes, constants, and references (norma ...
, e.g.
Java
Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's mo ...
. It aims to optimize developer productivity by using
convention over configuration
Convention over configuration (also known as coding by convention) is a software design paradigm used by software frameworks that attempts to decrease the number of decisions that a developer using the framework is required to make without necess ...
, 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
sbt is an open-source build tool for Scala and Java projects, similar to Apache's Maven and Gradle.
Its main features are:
*Native support for compiling Scala code and integrating with many Scala test frameworks
*Continuous compilation, te ...
, and
templates
Template may refer to:
Tools
* Die (manufacturing), used to cut or shape material
* Mold, in a molding process
* Stencil, a pattern or overlay used in graphic arts (drawing, painting, etc.) and sewing to replicate letters, shapes or designs
Co ...
use Scala instead of
Apache Groovy
Apache Groovy is a Java-syntax-compatible object-oriented programming language for the Java platform. It is both a static and dynamic language with features similar to those of Python, Ruby, and Smalltalk. It can be used as both a programming lan ...
.
History
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.
Motivation
Play is heavily inspired by
ASP.NET MVC
ASP.NET MVC is a web application framework developed by Microsoft that implements the model–view–controller (MVC) pattern. It is no longer in active development. It is open-source software, apart from the ASP.NET Web Forms component, which is ...
,
Ruby on Rails
Ruby on Rails (simplified as Rails) is a server-side web application framework written in Ruby under the MIT License. Rails is a model–view–controller (MVC) framework, providing default structures for a database, a web service, and web ...
and
Django
Django may refer to:
Arts and entertainment Film
* ''Django'' (1966 film), a 1966 Italian Western by Sergio Corbucci which had a particular influence on the Spaghetti Western genre and a number of unofficial prequels and sequels
** ''Django, Prep ...
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
Jakarta EE, formerly Java Platform, Enterprise Edition (Java EE) and Java 2 Platform, Enterprise Edition (J2EE), is a set of specifications, extending Java SE with specifications for enterprise features such as distributed computing and web serv ...
-centric. Play uses no Java EE constraints. This can make Play simpler to develop compared to other Java-centric platforms.
Although Play 1.x could also be packaged as
WAR
War is an intense armed conflict between states, governments, societies, or paramilitary groups such as mercenaries, insurgents, and militias. It is generally characterized by extreme violence, destruction, and mortality, using regular o ...
files to be distributed to standard Java EE
application servers, Play 2.x applications are now designed to be run using the built-in
Akka HTTP
Akka or AKKA may refer to:
Arts and entertainment
* Akka (film), ''Akka'' (film), a 1976 Indian Tamil film
* Akka (TV series), ''Akka'' (TV series), a 2014–2015 Indian Tamil soap opera
* Akka, a character in the children's novel ''The Wonderful ...
or
Netty
Netty may refer to:
* Netty (software), a Java project
* North East England (Geordie) dialect for toilet or public convenience
* Netty (name)
See also
* Westoe Netty
* Nethy (disambiguation)
* Natty (disambiguation)
*Netta (disambiguation) '' ...
web servers exclusively.
Major differences from Java frameworks
*
Stateless: Play 2 is fully
RESTful – there is no Java EE session per connection.
* Integrated unit testing:
JUnit
JUnit is a unit testing framework for the Java programming language. JUnit has been important in the development of test-driven development, and is one of a family of unit testing frameworks which is collectively known as xUnit that originated ...
and
Selenium
Selenium is a chemical element with the symbol Se and atomic number 34. It is a nonmetal (more rarely considered a metalloid) with properties that are intermediate between the elements above and below in the periodic table, sulfur and telluriu ...
support is included in the core.
*
API
An application programming interface (API) is a way for two or more computer programs to communicate with each other. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how ...
comes with most required elements built-in.
*
Asynchronous I/O
In computer science, asynchronous I/O (also non-sequential I/O) is a form of input/output processing that permits other processing to continue before the transmission has finished. A name used for asynchronous I/O in the Windows API is overlap ...
: due to using Akka HTTP 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.
Testing framework
Play provides integration with test frameworks for
unit testing
In computer programming, unit testing is a software testing method by which individual units of source code—sets of one or more computer program modules together with associated control data, usage procedures, and operating procedures&m ...
and
functional testing
Functional testing is a quality assurance (QA) processPrasad, Dr. K.V.K.K. (2008) ''ISTQB Certification Study Guide'', Wiley, , p. vi and a type of black-box testing that bases its test cases on the specifications of the software component unde ...
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
JUnit is a unit testing framework for the Java programming language. JUnit has been important in the development of test-driven development, and is one of a family of unit testing frameworks which is collectively known as xUnit that originated ...
4. For both languages, there is also integration with
Selenium (software)
Selenium is an open source umbrella project for a range of tools and libraries aimed at supporting browser automation. It provides a playback tool for authoring functional tests across most modern web browsers, without the need to learn a tes ...
.
SBT
sbt is an open-source build tool for Scala and Java projects, similar to Apache's Maven and Gradle.
Its main features are:
*Native support for compiling Scala code and integrating with many Scala test frameworks
*Continuous compilation, te ...
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 a
scoverageo
jacoco4sbt
Usage
In August 2011,
Heroku
Heroku is a cloud platform as a service (PaaS) supporting several programming languages. One of the first cloud platforms, Heroku has been in development since June 2007, when it supported only the Ruby programming language, but now supports Java, ...
announced native support for Play applications on its
cloud computing
Cloud computing is the on-demand availability of computer system resources, especially data storage ( cloud storage) and computing power, without direct active management by the user. Large clouds often have functions distributed over m ...
platform. This followed module-based support for Play 1.0 on
Google App Engine
Google App Engine (often referred to as GAE or simply App Engine) is a cloud computing platform as a service for developing and hosting web applications in Google-managed data centers. Applications are sandboxed and run across multiple servers ...
, and documented support on
Amazon Web Services
Amazon Web Services, Inc. (AWS) is a subsidiary of Amazon.com, Amazon that provides Software as a service, on-demand cloud computing computing platform, platforms and Application programming interface, APIs to individuals, companies, and gover ...
.
, the Play Framework was the most popular Scala project on
GitHub
GitHub, Inc. () is an Internet hosting service for software development and version control using Git. It provides the distributed version control of Git plus access control, bug tracking, software feature requests, task management, co ...
.
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.
Corporate users of the Play Framework have included
Coursera
Coursera Inc. () is a U.S.-based massive open online course provider founded in 2012 by Stanford University computer science professors Andrew Ng and Daphne Koller. Coursera works with universities and other organizations to offer online cour ...
,
HuffPost
''HuffPost'' (formerly ''The Huffington Post'' until 2017 and sometimes abbreviated ''HuffPo'') is an American progressive news website, with localized and international editions. The site offers news, satire, blogs, and original content, and ...
,
Hootsuite
Hootsuite is a social media management platform, created by Ryan Holmes in 2008. The system's user interface takes the form of a dashboard, and supports social network integrations for Twitter, Facebook, Instagram, LinkedIn, Pinterest, YouTube ...
,
Janrain
Janrain, sometimes styled as JanRain, is a customer profile and identity management (CIAM) software provider based in Portland, Oregon, United States. It was established in 2002. Akamai acquired Janrain in January 2019.
History
Janrain was fou ...
,
LinkedIn
LinkedIn () is an American business and employment-oriented online service that operates via websites and mobile apps. Launched on May 5, 2003, the platform is primarily used for professional networking and career development, and allows job s ...
, and
Connectifier
Connectifier was an American company that developed machine learning-based searching and matching technology to help recruiters and hiring managers find talent. The company was acquired by LinkedIn in February 2016 and operated as a wholly owned s ...
.
See also
*
Akka (toolkit)
Akka is a source-available toolkit and runtime simplifying the construction of concurrent and distributed applications on the JVM. Akka supports multiple programming models for concurrency, but it emphasizes actor-based concurrency, with inspi ...
*
Ebean
Ebean is an object–relational mapping product written in Java. It is designed to be simpler to use and understand than JPA (Java Persistence API) or JDO (Java Data Objects) products.
Simple API
Ebean has a simpler API than JPA. It achieves thi ...
*
Netty (software)
Netty is a non-blocking I/O client-server framework for the development of Java network applications such as protocol servers and clients. The asynchronous event-driven network application framework and tools are used to simplify network pro ...
*
Scala (programming language)
Literature
* Wayne Ellis (2010). Introducing the Play Framework.
* Alexander Reelsen (2011). Play Framework Cookbook. Packt Publishing. ISBN 1849515522.
*
*
*
*
*
*
*
References
External links
Play Framework home page
{{Web frameworks
Java platform
Web frameworks
Free software programmed in Java (programming language)
Free software programmed in Scala
2007 software
Software using the Apache license