<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jlourde</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jlourde"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Jlourde"/>
	<updated>2026-08-07T17:47:50Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_S1455&amp;diff=92028</id>
		<title>CSC/ECE 517 Fall 2014/final S1455</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/final_S1455&amp;diff=92028"/>
		<updated>2014-11-12T04:34:09Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* Design Principles */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page contains design details for the project for Sahana Eden Humanitarian Platform, on their Central African Republic deployment.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float:{{{align|right}}}&amp;quot;&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot; |[[File:SahanaLogo.png|center|Sahana]]&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
== Background Information ==&lt;br /&gt;
====About Sahana Eden====&lt;br /&gt;
Sahana Eden is an Open Source Humanitarian Platform, which can be used to provide solutions for Disaster Management, Development, and Environmental Management sectors. It is supported by the  Sahana Software Foundation, Used in many Deployments, such as Ebola, Kashmir Floods, Hurricane Sandy, just to name a few. It is highly configurable so that it can be used in a wide variety of different contexts and is easy to modify to build custom solutions. Different levels of support are available from both the voluntary Sahana Eden community and professional companies. Sahana focuses on Community and Professional Support.&lt;br /&gt;
&lt;br /&gt;
====Getting to know the domain====&lt;br /&gt;
&lt;br /&gt;
Their [http://eden.sahanafoundation.org/wiki/Domain domain] page elaborately describes various major management projects and deployments that are done in the past or are ongoing. Spending some time to understand goals and purposes of Sahana before starting with actual development might help making the code better and more sensible from Sahana's perspective.&lt;br /&gt;
&lt;br /&gt;
====Installation &amp;amp; tutorials====&lt;br /&gt;
&lt;br /&gt;
Anyone who wishes to contribute their development skill to Sahana, can do so with the help of an elaborate guide they have provided, that covers everything from [http://eden.sahanafoundation.org/wiki/InstallationGuidelines installation] to [http://eden.sahanafoundation.org/wiki/Book tutorials] on Python. Once the installations are complete, you can simply identify a task you are interested in, and start working on it. You may also want to sign their [https://docs.google.com/a/ncsu.edu/spreadsheet/viewform?formkey=dEp5czdPYThPY2htX2pNM1JGaTBrRGc6MQ#gid=0 Contributor's License Agreement] before making any pull request.&lt;br /&gt;
&lt;br /&gt;
Below is a high level overview to begin contributing to Sahana-&lt;br /&gt;
&lt;br /&gt;
The code is in the folder: web2py/applications/eden&lt;br /&gt;
&lt;br /&gt;
Inside that folder are folders for Models (define the data structure), Controllers (provide URLs to enable access to the data) &amp;amp; Views (HTML templates).&lt;br /&gt;
&lt;br /&gt;
Each module within Sahana Eden will normally consist of one of each of these files:&lt;br /&gt;
&lt;br /&gt;
    Model: modules/s3db/modulename.py&lt;br /&gt;
    Controller: controllers/modulename.py&lt;br /&gt;
    View: views/modulename/index.html&lt;br /&gt;
&lt;br /&gt;
In order to know which file to edit in order to change a particular function, you need to look at the URL. The Web2Py web framework maps URLs as follows:&lt;br /&gt;
&lt;br /&gt;
    http://host/application/controller/function&lt;br /&gt;
&lt;br /&gt;
So, if you want to edit the Home page with the URL:&lt;br /&gt;
&lt;br /&gt;
    http://host/eden/default/index&lt;br /&gt;
&lt;br /&gt;
This implies that you should look at the file eden/controllers/default.py and the index function within it which can be found by searching for the function title &amp;quot;def index():&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Tip: Sahana Eden makes heavy use of integrated resource controllers so the typical mapping is:&lt;br /&gt;
&lt;br /&gt;
    http://host/eden/module/resource&lt;br /&gt;
&lt;br /&gt;
The resource refers to a table with the name module_resource in the file modules/s3db/&amp;lt;module&amp;gt;.py&lt;br /&gt;
&lt;br /&gt;
==Introduction to project==&lt;br /&gt;
&lt;br /&gt;
====Overview====&lt;br /&gt;
In the Central African Republic page, some data needs new models, and some models need tweaking. The purpose of this project is to identify any such requirement and make necessary changes. The general steps to follow in Sahana development are mentioned below-&lt;br /&gt;
&lt;br /&gt;
1. Add/modify the core models in modules/s3db&lt;br /&gt;
&lt;br /&gt;
2. Add REST controllers for new models&lt;br /&gt;
&lt;br /&gt;
3. Check basic operations using automatic CRUD interface- tweak list_fields to the most-relevant fields perhaps &lt;br /&gt;
&lt;br /&gt;
4. Add menu entries (modules/s3menus.py)&lt;br /&gt;
&lt;br /&gt;
5. Develop XSLT &amp;amp; CSV templates (static/formats/s3csv) to bulk import the data&lt;br /&gt;
&lt;br /&gt;
6. Convert the data to these CSV templates- use ogr2ogr for this &lt;br /&gt;
&lt;br /&gt;
7. Add layers to the map (private/templates/&amp;lt;TEMPLATE&amp;gt;/gis_layer_feature.csv. Look at default for now) including Markers and tooltips (popup_format)&lt;br /&gt;
&lt;br /&gt;
8. Provide some report_options to make a meaningful report&lt;br /&gt;
&lt;br /&gt;
====Scope====&lt;br /&gt;
Four modules related to this deployment are-&lt;br /&gt;
&lt;br /&gt;
1. Health - modules/s3db/hms.py&lt;br /&gt;
&lt;br /&gt;
2. Transport - modules/s3db/transport.py&lt;br /&gt;
&lt;br /&gt;
3. Water - modules/s3db/water.py&lt;br /&gt;
&lt;br /&gt;
4. School - There is no separate module for education. &lt;br /&gt;
&lt;br /&gt;
====Reference Material====&lt;br /&gt;
&lt;br /&gt;
[http://www.humanitarianresponse.info/operations/central-african-republic/dataset/central-african-republic-health Hospital Model]&lt;br /&gt;
&lt;br /&gt;
[http://geonode.wfp.org/layers/geonode:wld_poi_bcp_wfp Border Control Points], [http://www.humanitarianresponse.info/operations/central-african-republic/dataset/central-african-republic-roads Roads], [http://geonode.wfp.org/layers/geonode:wld_trs_supplyroutes_wfp Routes], [http://www.humanitarianresponse.info/operations/central-african-republic/dataset/central-african-republic-aerodromes-airports-airfields Airports]&lt;br /&gt;
&lt;br /&gt;
[http://www.humanitarianresponse.info/operations/central-african-republic/dataset/central-african-republic-water-bodies Water Bodies], [http://www.humanitarianresponse.info/operations/central-african-republic/dataset/central-african-republic-water-bodies-0 Water Points], [http://www.humanitarianresponse.info/operations/central-african-republic/dataset/central-african-republic-water-courses Rivers]&lt;br /&gt;
&lt;br /&gt;
[http://www.humanitarianresponse.info/operations/central-african-republic/dataset/central-african-republic-education Education]&lt;br /&gt;
&lt;br /&gt;
==System Overview==&lt;br /&gt;
&lt;br /&gt;
Sahana Eden Framework:&lt;br /&gt;
&lt;br /&gt;
The Sahana Eden Software Platform has been built around a Rapid Application Development (RAD) Framework. This provides a high level of automation to ensure that new solutions can be quickly and effectively developed. Once a database table is defined, the Sahana Eden Framework automatically generates HTML pages to handle CRUD (Create, Read, Update, Delete) as well as Search, Map and Pivot Reports. Web Services are available to import and export in XML, CSV, JSON and EXtensible Stylesheet Language (XSL) transforms are supported to produce other data standards.&lt;br /&gt;
&lt;br /&gt;
The Sahana Eden Framework has flexible authorization policies which can be configured to grant permissions for different modules, tables as well as the ability to have multiple Organizations control their own data on a single Sahana Eden installation.&lt;br /&gt;
&lt;br /&gt;
Sahana Eden can be downloaded and run locally from a flash drive. Synchronization functionality allows data to be entered then keep up to date between different installations, including online servers and local flash drive installations. The Sahana Eden Framework also includes a scheduler for running tasks at a specific time, in regular intervals or as asynchronous tasks which are triggered by users. &lt;br /&gt;
&lt;br /&gt;
Sahana Eden is mainly implemented using Python, web2py, CSS and foundation. When you open the code in Eclipse, you can see that web2py is very much like Ruby on Rails. Analyze the screenshots below-&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: workspace.png]][[File: workspace2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Our focus is on Controllers, Models, Modules and views. For every action on various pages on Sahana Humanitarian website, there are set of controllers defined. As mentioned above, we want to focus on 4 models- health, transport, water and school.&lt;br /&gt;
&lt;br /&gt;
==System Architecture==&lt;br /&gt;
The basic Sahana Eden architecture is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=&amp;quot;width: 100%; border: 1px dotted rgb(0, 0, 0); border-collapse: collapse;&amp;quot; cellpadding=&amp;quot;5&amp;quot;&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td style=&amp;quot;border: 1px dotted rgb(0, 0, 0);&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;Web Server&amp;lt;/strong&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border: 1px dotted rgb(0, 0, 0);&amp;quot;&amp;gt;Apache&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border: 1px dotted rgb(0, 0, 0);&amp;quot;&amp;gt;Other web servers can also be used, such as Cherokee.&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td style=&amp;quot;border: 1px dotted rgb(0, 0, 0);&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;Application&amp;lt;/strong&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border: 1px dotted rgb(0, 0, 0);&amp;quot;&amp;gt;Sahana Eden&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border: 1px dotted rgb(0, 0, 0);&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td style=&amp;quot;border: 1px dotted rgb(0, 0, 0);&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;Web Application Framework&amp;lt;/strong&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border: 1px dotted rgb(0, 0, 0);&amp;quot;&amp;gt;Web2Py&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border: 1px dotted rgb(0, 0, 0);&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td style=&amp;quot;border: 1px dotted rgb(0, 0, 0);&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;Programming Language&amp;lt;/strong&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border: 1px dotted rgb(0, 0, 0);&amp;quot;&amp;gt;Python &amp;amp;amp; Java Script&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border: 1px dotted rgb(0, 0, 0);&amp;quot;&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td style=&amp;quot;border: 1px dotted rgb(0, 0, 0);&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;Database&amp;lt;/strong&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border: 1px dotted rgb(0, 0, 0);&amp;quot;&amp;gt;MySQL, PostgreSQL, or SQLite&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border: 1px dotted rgb(0, 0, 0);&amp;quot;&amp;gt;&amp;lt;p&amp;gt;MySQL, PostgreSQL, and SQLite are supported.&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;Other databases should be usable without major additional work since Web2Py supplies many connectors.&amp;lt;/p&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td style=&amp;quot;border: 1px dotted rgb(0, 0, 0);&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;Operating System&amp;lt;/strong&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border: 1px dotted rgb(0, 0, 0);&amp;quot;&amp;gt;Linux (Debian recommended)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border: 1px dotted rgb(0, 0, 0);&amp;quot;&amp;gt;Windows and Mac OS X are possible, but only recommended for single-user environments.&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirement Analysis==&lt;br /&gt;
&lt;br /&gt;
The requirements state that some of the data needs new models. Also, the school database states that there is no module for education. Even on the [http://www.humanitarianresponse.info/operations/central-african-republic/dataset/central-african-republic-education education website] of Central African Republic, it says that the data is incomplete. Addition of new module, say edu.py in s3db module, will solve this problem.&lt;br /&gt;
&lt;br /&gt;
For the purpose of this project, we will need to follow these steps-&lt;br /&gt;
&lt;br /&gt;
1. Installation and setup- Follow the installation guidlines provided by Sahana to build the system on individual machines. Then, do the setup for Git repository, i.e. forking Sahana eden repo and adding the original as remote branch.&lt;br /&gt;
&lt;br /&gt;
2. Identify properties for &amp;quot;edu.py&amp;quot; and define the basic data model in the models/ folder.&lt;br /&gt;
&lt;br /&gt;
3. Add corresponding controller which provides access to this resource. Create another new file, this time in the controllers/ folder.&lt;br /&gt;
&lt;br /&gt;
4. Define Field Types- By default fields are created with type string, however we may wish to use other data types. All fields have both client-side widgets &amp;amp; server-side validation automatically added based on their data type. &lt;br /&gt;
&lt;br /&gt;
5. Customize &amp;amp; Internationalize Field labels- Field labels are automatically generated from the field names, however we are able to customize these by adding a 'label' attribute. &lt;br /&gt;
&lt;br /&gt;
6. Add Links to other Resources.&lt;br /&gt;
&lt;br /&gt;
7. Override default CRUD Strings.&lt;br /&gt;
&lt;br /&gt;
8. Update the Menus- There are two levels of menu within the system: The top-level 'Modules Menu' is visible in all modules. Underneath that, each module has its own menu for for module-specific navigation.&lt;br /&gt;
&lt;br /&gt;
9. Test the changes.&lt;br /&gt;
&lt;br /&gt;
==Design Principles==&lt;br /&gt;
&lt;br /&gt;
For our project, the best design principle applicable is &amp;quot;Open Close Principle&amp;quot;. Since we are introducing a new module, there will definitely be extensions to it, but very few modifications.&lt;br /&gt;
&lt;br /&gt;
The common features/functions will be encapsulated to ensure that the code is &amp;quot;DRY&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==Proposed Test Cases==&lt;br /&gt;
&lt;br /&gt;
For end-user performance gains, Sahana Eden minimizes and compresses the CSS and JavaScript. While this approach works well for optimized end-user performance, to debug the CSS and JavaScript we shall enable debug mode in models/000_config.py  in our Sahana Eden server with the following setting:&lt;br /&gt;
&lt;br /&gt;
  settings.base.debug = True&lt;br /&gt;
&lt;br /&gt;
Once any changes to the CSS and JavaScript are working, then we can minimizes and compresses the CSS and JavaScript using:&lt;br /&gt;
&lt;br /&gt;
  static/scripts/tools/build.sahana.py&lt;br /&gt;
&lt;br /&gt;
Although this uses a web service, you get better results by downloading a local version of the Closure Compiler (a tool for making JavaScript download and run faster) to static/scripts/tools. It is also possible to quickly view a single page in debug mode by adding the ?debug=1 variable to the end of a URL.&lt;br /&gt;
&lt;br /&gt;
==Further Reading==&lt;br /&gt;
[https://groups.google.com/forum/#!forum/sahana-eden Public Google Forum to discuss any development issues]&lt;br /&gt;
&lt;br /&gt;
[http://sahanafoundation.org/sahana-launches-eurosha-humanitarian-data-site/ Sahana Launches EUROSHA Humanitarian Data Site]&lt;br /&gt;
&lt;br /&gt;
[http://sahanafoundation.org/eurosha-volunteer-diary/ A EUROSHA Volunteer Diary]&lt;br /&gt;
&lt;br /&gt;
[http://en.flossmanuals.net/sahana-eden/user-stories/ User stories]&lt;br /&gt;
&lt;br /&gt;
[http://www.un.org/apps/news/story.asp?NewsID=49300#.VGLHHo_wbK8 Central African Republic: UN urges support to meet basic needs in hard-hit province]&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Central_African_Republic Wiki Page]&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=VoQAxQgevEA War in the Central African Republic (Full Length Documentary)]&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=88756</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=88756"/>
		<updated>2014-09-26T04:51:00Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* Miscellaneous */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework&amp;lt;ref&amp;gt;http://typesafe.com/blog/announcing-play-framework-21-the-high-velocit&amp;lt;/ref&amp;gt; for Java and [http://en.wikipedia.org/wiki/Scala_(programming_language) Scala]. It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&amp;lt;ref&amp;gt;http://www.reactivemanifesto.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
[[File:rsz_play-logo1_-_copy.png|293px|thumb|right|Play framework logo]]&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt; The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History=== &lt;br /&gt;
&lt;br /&gt;
Below is the changes introduced in the releases: &amp;lt;ref&amp;gt;https://www.playframework.com/changelog&amp;lt;/ref&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Motivation of Play framework==&lt;br /&gt;
The classical web development frameworks assume a single-box architecture. Hence the organization of their design is around static, unique, change-intolerant data models which try to centralize the entire app's business logic. This traditional approach falls short in a number of areas such as complex data representations, data distributions, composability&amp;lt;ref&amp;gt;http://engineering.linkedin.com/play/play-framework-democratizing-functional-programming-modern-web-programmers.&amp;lt;/ref&amp;gt; Functional programming is adept at handling these modern coding challenges. Although an increasing number of programmers are following this programming paradigm, it is time before main stream developers become fluent with this model. This has inspired one more essential motivation of Play design: a progressive learning curve. The release history shows the gradual introduction of functional programming concepts and the transition from Java to Scala(a functional programming language)&lt;br /&gt;
Some of the major factors that motivated the development of Play framework are:&lt;br /&gt;
&lt;br /&gt;
*'''Creation of a stateless web framework'''&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*'''Having an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture'''&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*'''Provision of a full-stack web framework'''&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with [http://en.wikipedia.org/wiki/Ebean Ebean] by default with the option to use any other persistence mechanism. [http://en.wikipedia.org/wiki/JUnit  JUnit], Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*'''Catering to a developer friendly feature driven framework'''&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework#Motivation&amp;lt;/ref&amp;gt;&lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to [http://en.wikipedia.org/wiki/JSON JSON] and integration of compilers for CoffeeScript, [http://en.wikipedia.org/wiki/Less_(stylesheet_language) LESS] etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, [http://en.wikipedia.org/wiki/Representational_state_transfer RESTful] by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&lt;br /&gt;
&lt;br /&gt;
*It makes use of [http://en.wikipedia.org/wiki/Akka_(toolkit) Akka] which supports multiple programming models for [http://c2.com/cgi/wiki?MessagePassingConcurrency message based asynchronous concurrency]. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up.&lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. [http://en.wikipedia.org/wiki/Netty_(software) Netty] supports non - blocking I/O and hence it is not expensive to make such calls.&lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==Components of Play Framework==&lt;br /&gt;
[[File:Play framework components.png|frame|right|alt=Components of Play framework.|Components of Play framework]]&lt;br /&gt;
&lt;br /&gt;
'''Java'''&lt;br /&gt;
&lt;br /&gt;
The compiler and runtime (JVM)&amp;lt;ref&amp;gt;http://www.java.com/en/&amp;lt;/ref&amp;gt; do the heavy lifting so that your apps run super-fast and keeps running under load.&lt;br /&gt;
&lt;br /&gt;
'''Scala'''&lt;br /&gt;
&lt;br /&gt;
After the core was rewritten in Scala after release 2.0, Play provides an extensive Scala support.&lt;br /&gt;
&lt;br /&gt;
'''Templates'''&lt;br /&gt;
&lt;br /&gt;
Play 2.x comes with a really powerful Scala-based template engine. This new template engine’s design was inspired by ASP.NET Razor&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/ASP.NET_Razor_view_engine&amp;lt;/ref&amp;gt;. The Play template engine can be used to generate any text based format such as HTML, CSV or XML.&lt;br /&gt;
&lt;br /&gt;
'''SBT Build System'''&lt;br /&gt;
&lt;br /&gt;
Play includes a build system which is based on sbt, a non intrusive build tool for Java and Scala projects.&amp;lt;ref&amp;gt;http://www.scala-sbt.org/&amp;lt;/ref&amp;gt; There are certain default build settings which can be altered to suit individual project needs.&lt;br /&gt;
&lt;br /&gt;
'''Akka'''&lt;br /&gt;
&lt;br /&gt;
Akka uses the Actor Model to raise the abstraction level and provide a better platform to build correct concurrent and scalable applications.&lt;br /&gt;
&lt;br /&gt;
'''Web Sockets'''&lt;br /&gt;
&lt;br /&gt;
Play comes with an in-built support for Web Sockets. This combined with the Akka system can be used to easily develop web sockets which can handle large amounts of data.&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Using Play==&lt;br /&gt;
===Online resources===&lt;br /&gt;
*[https://www.playframework.com/documentation/2.4.x/Home Play Official Documentation]  - Current and detailed documentation on nearly every aspect of Play. It includes a version selector for information pertaining to specific versions of Play framework.&lt;br /&gt;
*[https://groups.google.com/forum/#!forum/play-framework Google groups for Play framework] - Provides assistance in sourcing relevant help &lt;br /&gt;
*[https://engineering.linkedin.com/play/play-framework-linkedin Play Framework App] - Setting up Play framework and building a sample application&lt;br /&gt;
&lt;br /&gt;
===Books===&lt;br /&gt;
*Packt Publishing, Andy Petrella, [http://www.barnesandnoble.com/w/learning-play-framework-2-andy-petrella/1114993793?ean=9781782160137 Learning Play! Framework 2] (3/26/2013), ISBN-13: 9781782160137 &lt;br /&gt;
*Packt Publishing, Alexander Reelsen, [http://www.amazon.com/Play-Framework-Cookbook-Alexander-Reelsen/dp/1849515522 Play Framework Cookbook] (8/8/2013), ISBN-13: 978-1849515528&lt;br /&gt;
*Manning Publications Company, Nicolas Leroux &amp;amp; Sietse de Kaper, [http://www.barnesandnoble.com/listing/2691685860386 Play for Java: Covers Play 2],  (3/31/2014), p.320 ,ISBN-13: 9781617290909&lt;br /&gt;
&lt;br /&gt;
===IDE Support===&lt;br /&gt;
Since Play supports hot reloading, code can be typed on the fly and output can be received on the browser screen. Since there is no specific compilation phase involved, coding on Play framework does not require a [http://en.wikipedia.org/wiki/Integrated_development_environment Integrated Development Environment (IDE)]&lt;br /&gt;
Although code writing would not require the maximum usage of the IDE, activities like debugging and assisted refractoring in Java and Scala require the use of these sophisticated tools.&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/2.4.x/IDE&amp;lt;/ref&amp;gt;&lt;br /&gt;
Play framework supports a host of famous IDE's like:&lt;br /&gt;
*Eclipse&lt;br /&gt;
A simple command &amp;lt;code&amp;gt;eclipse&amp;lt;/code&amp;gt; generates the required Eclipse configurations to convert the existing application to an Eclipse-ready one.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[my-first-play-app] $ eclipse&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*IntelliJ&lt;br /&gt;
This IDE does not require a command prompt to setup the project configurations. It provides a direct Play2.x project selection while creating a new project. Only perquisite is that the Scala and Play 2 plugins are enabled in the IDE.&lt;br /&gt;
&lt;br /&gt;
==Additional Information==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors, which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel.&lt;br /&gt;
&lt;br /&gt;
Below is the sample creation of code: &amp;lt;ref&amp;gt;http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The actor &amp;lt;code&amp;gt;MyActor&amp;lt;/code&amp;gt; can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file. This actor can start processing messages and the number of actors can be incremented dynamically by configuration changes.  &lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
&lt;br /&gt;
The following is a summary of the pros and cons of the 2 Play versions:&amp;lt;ref&amp;gt;http://stackoverflow.com/questions/8189893/what-are-the-major-differences-between-play-framework-1-0-and-2-0&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Involves Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Inversion of Control&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
*Stateless&lt;br /&gt;
The major difference between Play and other Java EE frameworks is that Play is stateless. There is no Java EE session per connection. &lt;br /&gt;
&lt;br /&gt;
*Independent of Servlet &lt;br /&gt;
Like other major Java frameworks such as Spring, JSF and Struts, Play does not depend on [http://en.wikipedia.org/wiki/Java_Servlet Servlets].&lt;br /&gt;
&lt;br /&gt;
*Asynchronous I/O&lt;br /&gt;
Because Play depends on JBoss Netty API, it can service long requests in a asynchronous manner rather than tying up HTTP request with business logic threads&amp;lt;ref&amp;gt;http://www.doublespring.com/play-framework/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Modular Architecture&lt;br /&gt;
Since Play is inspired from the Rails and Django frameworks, it adapts the concept of Modules.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks Comparison of web application frameworks]&lt;br /&gt;
*[https://www.playframework.com/documentation/2.2.2/PlayUserGroups Play User Groups]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=88754</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=88754"/>
		<updated>2014-09-26T04:45:59Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* MVC application model */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework&amp;lt;ref&amp;gt;http://typesafe.com/blog/announcing-play-framework-21-the-high-velocit&amp;lt;/ref&amp;gt; for Java and [http://en.wikipedia.org/wiki/Scala_(programming_language) Scala]. It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&amp;lt;ref&amp;gt;http://www.reactivemanifesto.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
[[File:rsz_play-logo1_-_copy.png|293px|thumb|right|Play framework logo]]&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt; The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History=== &lt;br /&gt;
&lt;br /&gt;
Below is the changes introduced in the releases: &amp;lt;ref&amp;gt;https://www.playframework.com/changelog&amp;lt;/ref&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Motivation of Play framework==&lt;br /&gt;
The classical web development frameworks assume a single-box architecture. Hence the organization of their design is around static, unique, change-intolerant data models which try to centralize the entire app's business logic. This traditional approach falls short in a number of areas such as complex data representations, data distributions, composability&amp;lt;ref&amp;gt;http://engineering.linkedin.com/play/play-framework-democratizing-functional-programming-modern-web-programmers.&amp;lt;/ref&amp;gt; Functional programming is adept at handling these modern coding challenges. Although an increasing number of programmers are following this programming paradigm, it is time before main stream developers become fluent with this model. This has inspired one more essential motivation of Play design: a progressive learning curve. The release history shows the gradual introduction of functional programming concepts and the transition from Java to Scala(a functional programming language)&lt;br /&gt;
Some of the major factors that motivated the development of Play framework are:&lt;br /&gt;
&lt;br /&gt;
*'''Creation of a stateless web framework'''&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*'''Having an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture'''&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*'''Provision of a full-stack web framework'''&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with [http://en.wikipedia.org/wiki/Ebean Ebean] by default with the option to use any other persistence mechanism. [http://en.wikipedia.org/wiki/JUnit  JUnit], Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*'''Catering to a developer friendly feature driven framework'''&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework#Motivation&amp;lt;/ref&amp;gt;&lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to [http://en.wikipedia.org/wiki/JSON JSON] and integration of compilers for CoffeeScript, [http://en.wikipedia.org/wiki/Less_(stylesheet_language) LESS] etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, [http://en.wikipedia.org/wiki/Representational_state_transfer RESTful] by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&lt;br /&gt;
&lt;br /&gt;
*It makes use of [http://en.wikipedia.org/wiki/Akka_(toolkit) Akka] which supports multiple programming models for [http://c2.com/cgi/wiki?MessagePassingConcurrency message based asynchronous concurrency]. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up.&lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. [http://en.wikipedia.org/wiki/Netty_(software) Netty] supports non - blocking I/O and hence it is not expensive to make such calls.&lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==Components of Play Framework==&lt;br /&gt;
[[File:Play framework components.png|frame|right|alt=Components of Play framework.|Components of Play framework]]&lt;br /&gt;
&lt;br /&gt;
'''Java'''&lt;br /&gt;
&lt;br /&gt;
The compiler and runtime (JVM)&amp;lt;ref&amp;gt;http://www.java.com/en/&amp;lt;/ref&amp;gt; do the heavy lifting so that your apps run super-fast and keeps running under load.&lt;br /&gt;
&lt;br /&gt;
'''Scala'''&lt;br /&gt;
&lt;br /&gt;
After the core was rewritten in Scala after release 2.0, Play provides an extensive Scala support.&lt;br /&gt;
&lt;br /&gt;
'''Templates'''&lt;br /&gt;
&lt;br /&gt;
Play 2.x comes with a really powerful Scala-based template engine. This new template engine’s design was inspired by ASP.NET Razor&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/ASP.NET_Razor_view_engine&amp;lt;/ref&amp;gt;. The Play template engine can be used to generate any text based format such as HTML, CSV or XML.&lt;br /&gt;
&lt;br /&gt;
'''SBT Build System'''&lt;br /&gt;
&lt;br /&gt;
Play includes a build system which is based on sbt, a non intrusive build tool for Java and Scala projects.&amp;lt;ref&amp;gt;http://www.scala-sbt.org/&amp;lt;/ref&amp;gt; There are certain default build settings which can be altered to suit individual project needs.&lt;br /&gt;
&lt;br /&gt;
'''Akka'''&lt;br /&gt;
&lt;br /&gt;
Akka uses the Actor Model to raise the abstraction level and provide a better platform to build correct concurrent and scalable applications.&lt;br /&gt;
&lt;br /&gt;
'''Web Sockets'''&lt;br /&gt;
&lt;br /&gt;
Play comes with an in-built support for Web Sockets. This combined with the Akka system can be used to easily develop web sockets which can handle large amounts of data.&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Using Play==&lt;br /&gt;
===Online resources===&lt;br /&gt;
*[https://www.playframework.com/documentation/2.4.x/Home Play Official Documentation]  - Current and detailed documentation on nearly every aspect of Play. It includes a version selector for information pertaining to specific versions of Play framework.&lt;br /&gt;
*[https://groups.google.com/forum/#!forum/play-framework Google groups for Play framework] - Provides assistance in sourcing relevant help &lt;br /&gt;
*[https://engineering.linkedin.com/play/play-framework-linkedin Play Framework App] - Setting up Play framework and building a sample application&lt;br /&gt;
&lt;br /&gt;
===Books===&lt;br /&gt;
*Packt Publishing, Andy Petrella, [http://www.barnesandnoble.com/w/learning-play-framework-2-andy-petrella/1114993793?ean=9781782160137 Learning Play! Framework 2] (3/26/2013), ISBN-13: 9781782160137 &lt;br /&gt;
*Packt Publishing, Alexander Reelsen, [http://www.amazon.com/Play-Framework-Cookbook-Alexander-Reelsen/dp/1849515522 Play Framework Cookbook] (8/8/2013), ISBN-13: 978-1849515528&lt;br /&gt;
*Manning Publications Company, Nicolas Leroux &amp;amp; Sietse de Kaper, [http://www.barnesandnoble.com/listing/2691685860386 Play for Java: Covers Play 2],  (3/31/2014), p.320 ,ISBN-13: 9781617290909&lt;br /&gt;
&lt;br /&gt;
===IDE Support===&lt;br /&gt;
Since Play supports hot reloading, code can be typed on the fly and output can be received on the browser screen. Since there is no specific compilation phase involved, coding on Play framework does not require a [http://en.wikipedia.org/wiki/Integrated_development_environment Integrated Development Environment (IDE)]&lt;br /&gt;
Although code writing would not require the maximum usage of the IDE, activities like debugging and assisted refractoring in Java and Scala require the use of these sophisticated tools.&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/2.4.x/IDE&amp;lt;/ref&amp;gt;&lt;br /&gt;
Play framework supports a host of famous IDE's like:&lt;br /&gt;
*Eclipse&lt;br /&gt;
A simple command &amp;lt;code&amp;gt;eclipse&amp;lt;/code&amp;gt; generates the required Eclipse configurations to convert the existing application to an Eclipse-ready one.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[my-first-play-app] $ eclipse&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*IntelliJ&lt;br /&gt;
This IDE does not require a command prompt to setup the project configurations. It provides a direct Play2.x project selection while creating a new project. Only perquisite is that the Scala and Play 2 plugins are enabled in the IDE.&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors, which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel.&lt;br /&gt;
&lt;br /&gt;
Below is the sample creation of code: &amp;lt;ref&amp;gt;http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The actor &amp;lt;code&amp;gt;MyActor&amp;lt;/code&amp;gt; can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file. This actor can start processing messages and the number of actors can be incremented dynamically by configuration changes.  &lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
&lt;br /&gt;
The following is a summary of the pros and cons of the 2 Play versions:&amp;lt;ref&amp;gt;http://stackoverflow.com/questions/8189893/what-are-the-major-differences-between-play-framework-1-0-and-2-0&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Involves Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Inversion of Control&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
*Stateless&lt;br /&gt;
The major difference between Play and other Java EE frameworks is that Play is stateless. There is no Java EE session per connection. &lt;br /&gt;
&lt;br /&gt;
*Independent of Servlet &lt;br /&gt;
Like other major Java frameworks such as Spring, JSF and Struts, Play does not depend on [http://en.wikipedia.org/wiki/Java_Servlet Servlets].&lt;br /&gt;
&lt;br /&gt;
*Asynchronous I/O&lt;br /&gt;
Because Play depends on JBoss Netty API, it can service long requests in a asynchronous manner rather than tying up HTTP request with business logic threads&amp;lt;ref&amp;gt;http://www.doublespring.com/play-framework/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Modular Architecture&lt;br /&gt;
Since Play is inspired from the Rails and Django frameworks, it adapts the concept of Modules.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=88753</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=88753"/>
		<updated>2014-09-26T04:45:08Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* Components of Play Framework */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework&amp;lt;ref&amp;gt;http://typesafe.com/blog/announcing-play-framework-21-the-high-velocit&amp;lt;/ref&amp;gt; for Java and [http://en.wikipedia.org/wiki/Scala_(programming_language) Scala]. It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&amp;lt;ref&amp;gt;http://www.reactivemanifesto.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
[[File:rsz_play-logo1_-_copy.png|293px|thumb|right|Play framework logo]]&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt; The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History=== &lt;br /&gt;
&lt;br /&gt;
Below is the changes introduced in the releases: &amp;lt;ref&amp;gt;https://www.playframework.com/changelog&amp;lt;/ref&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Motivation of Play framework==&lt;br /&gt;
The classical web development frameworks assume a single-box architecture. Hence the organization of their design is around static, unique, change-intolerant data models which try to centralize the entire app's business logic. This traditional approach falls short in a number of areas such as complex data representations, data distributions, composability&amp;lt;ref&amp;gt;http://engineering.linkedin.com/play/play-framework-democratizing-functional-programming-modern-web-programmers.&amp;lt;/ref&amp;gt; Functional programming is adept at handling these modern coding challenges. Although an increasing number of programmers are following this programming paradigm, it is time before main stream developers become fluent with this model. This has inspired one more essential motivation of Play design: a progressive learning curve. The release history shows the gradual introduction of functional programming concepts and the transition from Java to Scala(a functional programming language)&lt;br /&gt;
Some of the major factors that motivated the development of Play framework are:&lt;br /&gt;
&lt;br /&gt;
*'''Creation of a stateless web framework'''&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*'''Having an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture'''&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*'''Provision of a full-stack web framework'''&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with [http://en.wikipedia.org/wiki/Ebean Ebean] by default with the option to use any other persistence mechanism. [http://en.wikipedia.org/wiki/JUnit  JUnit], Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*'''Catering to a developer friendly feature driven framework'''&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework#Motivation&amp;lt;/ref&amp;gt;&lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to [http://en.wikipedia.org/wiki/JSON JSON] and integration of compilers for CoffeeScript, [http://en.wikipedia.org/wiki/Less_(stylesheet_language) LESS] etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, [http://en.wikipedia.org/wiki/Representational_state_transfer RESTful] by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&lt;br /&gt;
&lt;br /&gt;
*It makes use of [http://en.wikipedia.org/wiki/Akka_(toolkit) Akka] which supports multiple programming models for [http://c2.com/cgi/wiki?MessagePassingConcurrency message based asynchronous concurrency]. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up.&lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. [http://en.wikipedia.org/wiki/Netty_(software) Netty] supports non - blocking I/O and hence it is not expensive to make such calls.&lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==Components of Play Framework==&lt;br /&gt;
[[File:Play framework components.png|frame|right|alt=Components of Play framework.|Components of Play framework]]&lt;br /&gt;
&lt;br /&gt;
'''Java'''&lt;br /&gt;
&lt;br /&gt;
The compiler and runtime (JVM)&amp;lt;ref&amp;gt;http://www.java.com/en/&amp;lt;/ref&amp;gt; do the heavy lifting so that your apps run super-fast and keeps running under load.&lt;br /&gt;
&lt;br /&gt;
'''Scala'''&lt;br /&gt;
&lt;br /&gt;
After the core was rewritten in Scala after release 2.0, Play provides an extensive Scala support.&lt;br /&gt;
&lt;br /&gt;
'''Templates'''&lt;br /&gt;
&lt;br /&gt;
Play 2.x comes with a really powerful Scala-based template engine. This new template engine’s design was inspired by ASP.NET Razor&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/ASP.NET_Razor_view_engine&amp;lt;/ref&amp;gt;. The Play template engine can be used to generate any text based format such as HTML, CSV or XML.&lt;br /&gt;
&lt;br /&gt;
'''SBT Build System'''&lt;br /&gt;
&lt;br /&gt;
Play includes a build system which is based on sbt, a non intrusive build tool for Java and Scala projects.&amp;lt;ref&amp;gt;http://www.scala-sbt.org/&amp;lt;/ref&amp;gt; There are certain default build settings which can be altered to suit individual project needs.&lt;br /&gt;
&lt;br /&gt;
'''Akka'''&lt;br /&gt;
&lt;br /&gt;
Akka uses the Actor Model to raise the abstraction level and provide a better platform to build correct concurrent and scalable applications.&lt;br /&gt;
&lt;br /&gt;
'''Web Sockets'''&lt;br /&gt;
&lt;br /&gt;
Play comes with an in-built support for Web Sockets. This combined with the Akka system can be used to easily develop web sockets which can handle large amounts of data.&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/1.0/main&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Using Play==&lt;br /&gt;
===Online resources===&lt;br /&gt;
*[https://www.playframework.com/documentation/2.4.x/Home Play Official Documentation]  - Current and detailed documentation on nearly every aspect of Play. It includes a version selector for information pertaining to specific versions of Play framework.&lt;br /&gt;
*[https://groups.google.com/forum/#!forum/play-framework Google groups for Play framework] - Provides assistance in sourcing relevant help &lt;br /&gt;
*[https://engineering.linkedin.com/play/play-framework-linkedin Play Framework App] - Setting up Play framework and building a sample application&lt;br /&gt;
&lt;br /&gt;
===Books===&lt;br /&gt;
*Packt Publishing, Andy Petrella, [http://www.barnesandnoble.com/w/learning-play-framework-2-andy-petrella/1114993793?ean=9781782160137 Learning Play! Framework 2] (3/26/2013), ISBN-13: 9781782160137 &lt;br /&gt;
*Packt Publishing, Alexander Reelsen, [http://www.amazon.com/Play-Framework-Cookbook-Alexander-Reelsen/dp/1849515522 Play Framework Cookbook] (8/8/2013), ISBN-13: 978-1849515528&lt;br /&gt;
*Manning Publications Company, Nicolas Leroux &amp;amp; Sietse de Kaper, [http://www.barnesandnoble.com/listing/2691685860386 Play for Java: Covers Play 2],  (3/31/2014), p.320 ,ISBN-13: 9781617290909&lt;br /&gt;
&lt;br /&gt;
===IDE Support===&lt;br /&gt;
Since Play supports hot reloading, code can be typed on the fly and output can be received on the browser screen. Since there is no specific compilation phase involved, coding on Play framework does not require a [http://en.wikipedia.org/wiki/Integrated_development_environment Integrated Development Environment (IDE)]&lt;br /&gt;
Although code writing would not require the maximum usage of the IDE, activities like debugging and assisted refractoring in Java and Scala require the use of these sophisticated tools.&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/2.4.x/IDE&amp;lt;/ref&amp;gt;&lt;br /&gt;
Play framework supports a host of famous IDE's like:&lt;br /&gt;
*Eclipse&lt;br /&gt;
A simple command &amp;lt;code&amp;gt;eclipse&amp;lt;/code&amp;gt; generates the required Eclipse configurations to convert the existing application to an Eclipse-ready one.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[my-first-play-app] $ eclipse&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*IntelliJ&lt;br /&gt;
This IDE does not require a command prompt to setup the project configurations. It provides a direct Play2.x project selection while creating a new project. Only perquisite is that the Scala and Play 2 plugins are enabled in the IDE.&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors, which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel.&lt;br /&gt;
&lt;br /&gt;
Below is the sample creation of code: &amp;lt;ref&amp;gt;http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The actor &amp;lt;code&amp;gt;MyActor&amp;lt;/code&amp;gt; can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file. This actor can start processing messages and the number of actors can be incremented dynamically by configuration changes.  &lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
&lt;br /&gt;
The following is a summary of the pros and cons of the 2 Play versions:&amp;lt;ref&amp;gt;http://stackoverflow.com/questions/8189893/what-are-the-major-differences-between-play-framework-1-0-and-2-0&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Involves Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Inversion of Control&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
*Stateless&lt;br /&gt;
The major difference between Play and other Java EE frameworks is that Play is stateless. There is no Java EE session per connection. &lt;br /&gt;
&lt;br /&gt;
*Independent of Servlet &lt;br /&gt;
Like other major Java frameworks such as Spring, JSF and Struts, Play does not depend on [http://en.wikipedia.org/wiki/Java_Servlet Servlets].&lt;br /&gt;
&lt;br /&gt;
*Asynchronous I/O&lt;br /&gt;
Because Play depends on JBoss Netty API, it can service long requests in a asynchronous manner rather than tying up HTTP request with business logic threads&amp;lt;ref&amp;gt;http://www.doublespring.com/play-framework/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Modular Architecture&lt;br /&gt;
Since Play is inspired from the Rails and Django frameworks, it adapts the concept of Modules.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=88752</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=88752"/>
		<updated>2014-09-26T04:43:43Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* Components of Play Framework */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework&amp;lt;ref&amp;gt;http://typesafe.com/blog/announcing-play-framework-21-the-high-velocit&amp;lt;/ref&amp;gt; for Java and [http://en.wikipedia.org/wiki/Scala_(programming_language) Scala]. It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&amp;lt;ref&amp;gt;http://www.reactivemanifesto.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
[[File:rsz_play-logo1_-_copy.png|293px|thumb|right|Play framework logo]]&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt; The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History=== &lt;br /&gt;
&lt;br /&gt;
Below is the changes introduced in the releases: &amp;lt;ref&amp;gt;https://www.playframework.com/changelog&amp;lt;/ref&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Motivation of Play framework==&lt;br /&gt;
The classical web development frameworks assume a single-box architecture. Hence the organization of their design is around static, unique, change-intolerant data models which try to centralize the entire app's business logic. This traditional approach falls short in a number of areas such as complex data representations, data distributions, composability&amp;lt;ref&amp;gt;http://engineering.linkedin.com/play/play-framework-democratizing-functional-programming-modern-web-programmers.&amp;lt;/ref&amp;gt; Functional programming is adept at handling these modern coding challenges. Although an increasing number of programmers are following this programming paradigm, it is time before main stream developers become fluent with this model. This has inspired one more essential motivation of Play design: a progressive learning curve. The release history shows the gradual introduction of functional programming concepts and the transition from Java to Scala(a functional programming language)&lt;br /&gt;
Some of the major factors that motivated the development of Play framework are:&lt;br /&gt;
&lt;br /&gt;
*'''Creation of a stateless web framework'''&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*'''Having an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture'''&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*'''Provision of a full-stack web framework'''&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with [http://en.wikipedia.org/wiki/Ebean Ebean] by default with the option to use any other persistence mechanism. [http://en.wikipedia.org/wiki/JUnit  JUnit], Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*'''Catering to a developer friendly feature driven framework'''&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework#Motivation&amp;lt;/ref&amp;gt;&lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to [http://en.wikipedia.org/wiki/JSON JSON] and integration of compilers for CoffeeScript, [http://en.wikipedia.org/wiki/Less_(stylesheet_language) LESS] etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, [http://en.wikipedia.org/wiki/Representational_state_transfer RESTful] by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&lt;br /&gt;
&lt;br /&gt;
*It makes use of [http://en.wikipedia.org/wiki/Akka_(toolkit) Akka] which supports multiple programming models for [http://c2.com/cgi/wiki?MessagePassingConcurrency message based asynchronous concurrency]. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up.&lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. [http://en.wikipedia.org/wiki/Netty_(software) Netty] supports non - blocking I/O and hence it is not expensive to make such calls.&lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==Components of Play Framework==&lt;br /&gt;
[[File:Play framework components.png|frame|right|alt=Components of Play framework.|Components of Play framework]]&lt;br /&gt;
&lt;br /&gt;
'''Java'''&lt;br /&gt;
&lt;br /&gt;
The compiler and runtime (JVM)&amp;lt;ref&amp;gt;http://www.java.com/en/&amp;lt;/ref&amp;gt; do the heavy lifting so that your apps run super-fast and keeps running under load.&lt;br /&gt;
&lt;br /&gt;
'''Scala'''&lt;br /&gt;
&lt;br /&gt;
After the core was rewritten in Scala after release 2.0, Play provides an extensive Scala support.&lt;br /&gt;
&lt;br /&gt;
'''Templates'''&lt;br /&gt;
&lt;br /&gt;
Play 2.x comes with a really powerful Scala-based template engine. This new template engine’s design was inspired by ASP.NET Razor. The Play template engine can be used to generate any text based format such as HTML, CSV or XML.&lt;br /&gt;
&lt;br /&gt;
'''SBT Build System'''&lt;br /&gt;
&lt;br /&gt;
Play includes a build system which is based on sbt, a non intrusive build tool for Java and Scala projects.&amp;lt;ref&amp;gt;http://www.scala-sbt.org/&amp;lt;/ref&amp;gt; There are certain default build settings which can be altered to suit individual project needs.&lt;br /&gt;
&lt;br /&gt;
'''Akka'''&lt;br /&gt;
&lt;br /&gt;
Akka uses the Actor Model to raise the abstraction level and provide a better platform to build correct concurrent and scalable applications.&lt;br /&gt;
&lt;br /&gt;
'''Web Sockets'''&lt;br /&gt;
&lt;br /&gt;
Play comes with an in-built support for Web Sockets. This combined with the Akka system can be used to easily develop web sockets which can handle large amounts of data.&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/1.0/main&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Using Play==&lt;br /&gt;
===Online resources===&lt;br /&gt;
*[https://www.playframework.com/documentation/2.4.x/Home Play Official Documentation]  - Current and detailed documentation on nearly every aspect of Play. It includes a version selector for information pertaining to specific versions of Play framework.&lt;br /&gt;
*[https://groups.google.com/forum/#!forum/play-framework Google groups for Play framework] - Provides assistance in sourcing relevant help &lt;br /&gt;
*[https://engineering.linkedin.com/play/play-framework-linkedin Play Framework App] - Setting up Play framework and building a sample application&lt;br /&gt;
&lt;br /&gt;
===Books===&lt;br /&gt;
*Packt Publishing, Andy Petrella, [http://www.barnesandnoble.com/w/learning-play-framework-2-andy-petrella/1114993793?ean=9781782160137 Learning Play! Framework 2] (3/26/2013), ISBN-13: 9781782160137 &lt;br /&gt;
*Packt Publishing, Alexander Reelsen, [http://www.amazon.com/Play-Framework-Cookbook-Alexander-Reelsen/dp/1849515522 Play Framework Cookbook] (8/8/2013), ISBN-13: 978-1849515528&lt;br /&gt;
*Manning Publications Company, Nicolas Leroux &amp;amp; Sietse de Kaper, [http://www.barnesandnoble.com/listing/2691685860386 Play for Java: Covers Play 2],  (3/31/2014), p.320 ,ISBN-13: 9781617290909&lt;br /&gt;
&lt;br /&gt;
===IDE Support===&lt;br /&gt;
Since Play supports hot reloading, code can be typed on the fly and output can be received on the browser screen. Since there is no specific compilation phase involved, coding on Play framework does not require a [http://en.wikipedia.org/wiki/Integrated_development_environment Integrated Development Environment (IDE)]&lt;br /&gt;
Although code writing would not require the maximum usage of the IDE, activities like debugging and assisted refractoring in Java and Scala require the use of these sophisticated tools.&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/2.4.x/IDE&amp;lt;/ref&amp;gt;&lt;br /&gt;
Play framework supports a host of famous IDE's like:&lt;br /&gt;
*Eclipse&lt;br /&gt;
A simple command &amp;lt;code&amp;gt;eclipse&amp;lt;/code&amp;gt; generates the required Eclipse configurations to convert the existing application to an Eclipse-ready one.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[my-first-play-app] $ eclipse&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*IntelliJ&lt;br /&gt;
This IDE does not require a command prompt to setup the project configurations. It provides a direct Play2.x project selection while creating a new project. Only perquisite is that the Scala and Play 2 plugins are enabled in the IDE.&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors, which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel.&lt;br /&gt;
&lt;br /&gt;
Below is the sample creation of code: &amp;lt;ref&amp;gt;http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The actor &amp;lt;code&amp;gt;MyActor&amp;lt;/code&amp;gt; can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file. This actor can start processing messages and the number of actors can be incremented dynamically by configuration changes.  &lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
&lt;br /&gt;
The following is a summary of the pros and cons of the 2 Play versions:&amp;lt;ref&amp;gt;http://stackoverflow.com/questions/8189893/what-are-the-major-differences-between-play-framework-1-0-and-2-0&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Involves Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Inversion of Control&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
*Stateless&lt;br /&gt;
The major difference between Play and other Java EE frameworks is that Play is stateless. There is no Java EE session per connection. &lt;br /&gt;
&lt;br /&gt;
*Independent of Servlet &lt;br /&gt;
Like other major Java frameworks such as Spring, JSF and Struts, Play does not depend on [http://en.wikipedia.org/wiki/Java_Servlet Servlets].&lt;br /&gt;
&lt;br /&gt;
*Asynchronous I/O&lt;br /&gt;
Because Play depends on JBoss Netty API, it can service long requests in a asynchronous manner rather than tying up HTTP request with business logic threads&amp;lt;ref&amp;gt;http://www.doublespring.com/play-framework/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Modular Architecture&lt;br /&gt;
Since Play is inspired from the Rails and Django frameworks, it adapts the concept of Modules.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=88751</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=88751"/>
		<updated>2014-09-26T04:42:04Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* Components of Play Framework */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework&amp;lt;ref&amp;gt;http://typesafe.com/blog/announcing-play-framework-21-the-high-velocit&amp;lt;/ref&amp;gt; for Java and [http://en.wikipedia.org/wiki/Scala_(programming_language) Scala]. It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&amp;lt;ref&amp;gt;http://www.reactivemanifesto.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
[[File:rsz_play-logo1_-_copy.png|293px|thumb|right|Play framework logo]]&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt; The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History=== &lt;br /&gt;
&lt;br /&gt;
Below is the changes introduced in the releases: &amp;lt;ref&amp;gt;https://www.playframework.com/changelog&amp;lt;/ref&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Motivation of Play framework==&lt;br /&gt;
The classical web development frameworks assume a single-box architecture. Hence the organization of their design is around static, unique, change-intolerant data models which try to centralize the entire app's business logic. This traditional approach falls short in a number of areas such as complex data representations, data distributions, composability&amp;lt;ref&amp;gt;http://engineering.linkedin.com/play/play-framework-democratizing-functional-programming-modern-web-programmers.&amp;lt;/ref&amp;gt; Functional programming is adept at handling these modern coding challenges. Although an increasing number of programmers are following this programming paradigm, it is time before main stream developers become fluent with this model. This has inspired one more essential motivation of Play design: a progressive learning curve. The release history shows the gradual introduction of functional programming concepts and the transition from Java to Scala(a functional programming language)&lt;br /&gt;
Some of the major factors that motivated the development of Play framework are:&lt;br /&gt;
&lt;br /&gt;
*'''Creation of a stateless web framework'''&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*'''Having an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture'''&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*'''Provision of a full-stack web framework'''&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with [http://en.wikipedia.org/wiki/Ebean Ebean] by default with the option to use any other persistence mechanism. [http://en.wikipedia.org/wiki/JUnit  JUnit], Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*'''Catering to a developer friendly feature driven framework'''&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework#Motivation&amp;lt;/ref&amp;gt;&lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to [http://en.wikipedia.org/wiki/JSON JSON] and integration of compilers for CoffeeScript, [http://en.wikipedia.org/wiki/Less_(stylesheet_language) LESS] etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, [http://en.wikipedia.org/wiki/Representational_state_transfer RESTful] by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&lt;br /&gt;
&lt;br /&gt;
*It makes use of [http://en.wikipedia.org/wiki/Akka_(toolkit) Akka] which supports multiple programming models for [http://c2.com/cgi/wiki?MessagePassingConcurrency message based asynchronous concurrency]. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up.&lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. [http://en.wikipedia.org/wiki/Netty_(software) Netty] supports non - blocking I/O and hence it is not expensive to make such calls.&lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==Components of Play Framework==&lt;br /&gt;
[[File:Play framework components.png|frame|right|alt=Components of Play framework.|Components of Play framework]]&lt;br /&gt;
&lt;br /&gt;
'''Java'''&lt;br /&gt;
&lt;br /&gt;
The compiler and runtime (JVM)&amp;lt;ref&amp;gt;http://www.java.com/en/&amp;lt;/ref&amp;gt; do the heavy lifting so that your apps run super-fast and keeps running under load.&lt;br /&gt;
&lt;br /&gt;
'''Scala'''&lt;br /&gt;
&lt;br /&gt;
After the core was rewritten in Scala after release 2.0, Play provides an extensive Scala support.&lt;br /&gt;
&lt;br /&gt;
'''Templates'''&lt;br /&gt;
&lt;br /&gt;
Play 2.x comes with a really powerful Scala-based template engine. This new template engine’s design was inspired by ASP.NET Razor. The Play template engine can be used to generate any text based format such as HTML, CSV or XML.&lt;br /&gt;
&lt;br /&gt;
'''SBT Build System'''&lt;br /&gt;
&lt;br /&gt;
Play includes a build system which is based on sbt, a non intrusive build tool for Java and Scala projects.&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/2.0/Build&amp;lt;/ref&amp;gt; There are certain default build settings which can be altered to suit individual project needs.&lt;br /&gt;
&lt;br /&gt;
'''Akka'''&lt;br /&gt;
&lt;br /&gt;
Akka uses the Actor Model to raise the abstraction level and provide a better platform to build correct concurrent and scalable applications.&lt;br /&gt;
&lt;br /&gt;
'''Web Sockets'''&lt;br /&gt;
&lt;br /&gt;
Play comes with an in-built support for Web Sockets. This combined with the Akka system can be used to easily develop web sockets which can handle large amounts of data.&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/1.0/main&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Using Play==&lt;br /&gt;
===Online resources===&lt;br /&gt;
*[https://www.playframework.com/documentation/2.4.x/Home Play Official Documentation]  - Current and detailed documentation on nearly every aspect of Play. It includes a version selector for information pertaining to specific versions of Play framework.&lt;br /&gt;
*[https://groups.google.com/forum/#!forum/play-framework Google groups for Play framework] - Provides assistance in sourcing relevant help &lt;br /&gt;
*[https://engineering.linkedin.com/play/play-framework-linkedin Play Framework App] - Setting up Play framework and building a sample application&lt;br /&gt;
&lt;br /&gt;
===Books===&lt;br /&gt;
*Packt Publishing, Andy Petrella, [http://www.barnesandnoble.com/w/learning-play-framework-2-andy-petrella/1114993793?ean=9781782160137 Learning Play! Framework 2] (3/26/2013), ISBN-13: 9781782160137 &lt;br /&gt;
*Packt Publishing, Alexander Reelsen, [http://www.amazon.com/Play-Framework-Cookbook-Alexander-Reelsen/dp/1849515522 Play Framework Cookbook] (8/8/2013), ISBN-13: 978-1849515528&lt;br /&gt;
*Manning Publications Company, Nicolas Leroux &amp;amp; Sietse de Kaper, [http://www.barnesandnoble.com/listing/2691685860386 Play for Java: Covers Play 2],  (3/31/2014), p.320 ,ISBN-13: 9781617290909&lt;br /&gt;
&lt;br /&gt;
===IDE Support===&lt;br /&gt;
Since Play supports hot reloading, code can be typed on the fly and output can be received on the browser screen. Since there is no specific compilation phase involved, coding on Play framework does not require a [http://en.wikipedia.org/wiki/Integrated_development_environment Integrated Development Environment (IDE)]&lt;br /&gt;
Although code writing would not require the maximum usage of the IDE, activities like debugging and assisted refractoring in Java and Scala require the use of these sophisticated tools.&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/2.4.x/IDE&amp;lt;/ref&amp;gt;&lt;br /&gt;
Play framework supports a host of famous IDE's like:&lt;br /&gt;
*Eclipse&lt;br /&gt;
A simple command &amp;lt;code&amp;gt;eclipse&amp;lt;/code&amp;gt; generates the required Eclipse configurations to convert the existing application to an Eclipse-ready one.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[my-first-play-app] $ eclipse&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*IntelliJ&lt;br /&gt;
This IDE does not require a command prompt to setup the project configurations. It provides a direct Play2.x project selection while creating a new project. Only perquisite is that the Scala and Play 2 plugins are enabled in the IDE.&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors, which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel.&lt;br /&gt;
&lt;br /&gt;
Below is the sample creation of code: &amp;lt;ref&amp;gt;http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The actor &amp;lt;code&amp;gt;MyActor&amp;lt;/code&amp;gt; can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file. This actor can start processing messages and the number of actors can be incremented dynamically by configuration changes.  &lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
&lt;br /&gt;
The following is a summary of the pros and cons of the 2 Play versions:&amp;lt;ref&amp;gt;http://stackoverflow.com/questions/8189893/what-are-the-major-differences-between-play-framework-1-0-and-2-0&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Involves Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Inversion of Control&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
*Stateless&lt;br /&gt;
The major difference between Play and other Java EE frameworks is that Play is stateless. There is no Java EE session per connection. &lt;br /&gt;
&lt;br /&gt;
*Independent of Servlet &lt;br /&gt;
Like other major Java frameworks such as Spring, JSF and Struts, Play does not depend on [http://en.wikipedia.org/wiki/Java_Servlet Servlets].&lt;br /&gt;
&lt;br /&gt;
*Asynchronous I/O&lt;br /&gt;
Because Play depends on JBoss Netty API, it can service long requests in a asynchronous manner rather than tying up HTTP request with business logic threads&amp;lt;ref&amp;gt;http://www.doublespring.com/play-framework/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Modular Architecture&lt;br /&gt;
Since Play is inspired from the Rails and Django frameworks, it adapts the concept of Modules.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87829</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87829"/>
		<updated>2014-09-20T03:57:25Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt; It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&amp;lt;ref&amp;gt;http://www.reactivemanifesto.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
[[File:rsz_play-logo1_-_copy.png|293px|thumb|right|Play framework logo]]&lt;br /&gt;
==Motivation==&lt;br /&gt;
*To create a stateless web framework&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*To have an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*To provide full-stack web framework&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with Ebean by default with the option to use any other persistence mechanism. [http://en.wikipedia.org/wiki/JUnit  JUnit], Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*To provide a developer friendly feature driven framework&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework#Motivation&amp;lt;/ref&amp;gt;&lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to [http://en.wikipedia.org/wiki/JSON JSON] and integration of compilers for CoffeeScript, LESS etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, RESTful by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play makes use of [http://en.wikipedia.org/wiki/Akka_(toolkit) Akka] which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. [http://en.wikipedia.org/wiki/Netty_(software) Netty] supports non - blocking I/O and hence it is not expensive to make such calls.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt; The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History=== &lt;br /&gt;
&lt;br /&gt;
Below is the changes introduced in the releases: &amp;lt;ref&amp;gt;https://www.playframework.com/changelog&amp;lt;/ref&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/1.0/main&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. The model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory is the directory that imparts the feature of configuration-over-convention to the framework. It contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
Play.application().configuration().getInt(&amp;quot;number&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Compilation Errors===&lt;br /&gt;
The Play framework provides a hot deployment functionality. It means that code need not be compiled before deployment on the server. The developer can write the piece of code and directly hit refresh to execute the code. The compilation and execution happens at the time of deployment. Compilation errors, if any, are directly shown on the browser screen.&lt;br /&gt;
&lt;br /&gt;
Since, compilation and packaging happen at the time of deployment, Play does not have an elaborate development cycle. Although, two distinctive server modes are supported by Play. The '''DEV''' mode to be used for development purposes and the '''PROD''' mode when application is deployed. The main difference between the two modes is that hot reloading is not supported in the production mode.&lt;br /&gt;
&lt;br /&gt;
===IDE Support===&lt;br /&gt;
Since Play supports hot reloading, code can be typed on the fly and output can be received on the browser screen. Since there is no specific compilation phase involved, coding on Play framework does not require a [http://en.wikipedia.org/wiki/Integrated_development_environment Integrated Development Environment (IDE)]&lt;br /&gt;
Although code writing would not require the maximum usage of the IDE, activities like debugging and assisted refractoring in Java and Scala require the use of these sophisticated tools.&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/2.4.x/IDE&amp;lt;/ref&amp;gt;&lt;br /&gt;
Play framework supports a host of famous IDE's like:&lt;br /&gt;
*Eclipse&lt;br /&gt;
A simple command &amp;lt;code&amp;gt;eclipsify&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;eclipse&amp;lt;/code&amp;gt; generates the required Eclipse configurations to convert the existing application to an Eclipse-ready one.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[my-first-play-app] $ eclipse&lt;br /&gt;
[my-first-play-app] $ eclipsify&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*IntelliJ&lt;br /&gt;
This IDE does not require a command prompt to setup the project configurations. It provides a direct Play2.x project selection while creating a new project. Only perquisite is that the Scala and Play 2 plugins are enabled in the IDE.&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors, which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel.&lt;br /&gt;
&lt;br /&gt;
Below is the sample creation of code: &amp;lt;ref&amp;gt;http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above actor &amp;lt;code&amp;gt;MyActor&amp;lt;/code&amp;gt; can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file.&lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
&lt;br /&gt;
The following is a summary of the pros and cons of the 2 Play versions:&amp;lt;ref&amp;gt;http://stackoverflow.com/questions/8189893/what-are-the-major-differences-between-play-framework-1-0-and-2-0&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Involves Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Inversion of Control&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87828</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87828"/>
		<updated>2014-09-20T03:56:56Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* IDE Support */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt; It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&amp;lt;ref&amp;gt;http://www.reactivemanifesto.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
[[File:rsz_play-logo1_-_copy.png|293px|thumb|right|Play framework© logo]]&lt;br /&gt;
==Motivation==&lt;br /&gt;
*To create a stateless web framework&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*To have an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*To provide full-stack web framework&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with Ebean by default with the option to use any other persistence mechanism. [http://en.wikipedia.org/wiki/JUnit  JUnit], Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*To provide a developer friendly feature driven framework&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework#Motivation&amp;lt;/ref&amp;gt;&lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to [http://en.wikipedia.org/wiki/JSON JSON] and integration of compilers for CoffeeScript, LESS etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, RESTful by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play makes use of [http://en.wikipedia.org/wiki/Akka_(toolkit) Akka] which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. [http://en.wikipedia.org/wiki/Netty_(software) Netty] supports non - blocking I/O and hence it is not expensive to make such calls.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt; The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History=== &lt;br /&gt;
&lt;br /&gt;
Below is the changes introduced in the releases: &amp;lt;ref&amp;gt;https://www.playframework.com/changelog&amp;lt;/ref&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/1.0/main&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. The model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory is the directory that imparts the feature of configuration-over-convention to the framework. It contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
Play.application().configuration().getInt(&amp;quot;number&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Compilation Errors===&lt;br /&gt;
The Play framework provides a hot deployment functionality. It means that code need not be compiled before deployment on the server. The developer can write the piece of code and directly hit refresh to execute the code. The compilation and execution happens at the time of deployment. Compilation errors, if any, are directly shown on the browser screen.&lt;br /&gt;
&lt;br /&gt;
Since, compilation and packaging happen at the time of deployment, Play does not have an elaborate development cycle. Although, two distinctive server modes are supported by Play. The '''DEV''' mode to be used for development purposes and the '''PROD''' mode when application is deployed. The main difference between the two modes is that hot reloading is not supported in the production mode.&lt;br /&gt;
&lt;br /&gt;
===IDE Support===&lt;br /&gt;
Since Play supports hot reloading, code can be typed on the fly and output can be received on the browser screen. Since there is no specific compilation phase involved, coding on Play framework does not require a [http://en.wikipedia.org/wiki/Integrated_development_environment Integrated Development Environment (IDE)]&lt;br /&gt;
Although code writing would not require the maximum usage of the IDE, activities like debugging and assisted refractoring in Java and Scala require the use of these sophisticated tools.&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/2.4.x/IDE&amp;lt;/ref&amp;gt;&lt;br /&gt;
Play framework supports a host of famous IDE's like:&lt;br /&gt;
*Eclipse&lt;br /&gt;
A simple command &amp;lt;code&amp;gt;eclipsify&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;eclipse&amp;lt;/code&amp;gt; generates the required Eclipse configurations to convert the existing application to an Eclipse-ready one.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[my-first-play-app] $ eclipse&lt;br /&gt;
[my-first-play-app] $ eclipsify&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*IntelliJ&lt;br /&gt;
This IDE does not require a command prompt to setup the project configurations. It provides a direct Play2.x project selection while creating a new project. Only perquisite is that the Scala and Play 2 plugins are enabled in the IDE.&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors, which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel.&lt;br /&gt;
&lt;br /&gt;
Below is the sample creation of code: &amp;lt;ref&amp;gt;http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above actor &amp;lt;code&amp;gt;MyActor&amp;lt;/code&amp;gt; can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file.&lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
&lt;br /&gt;
The following is a summary of the pros and cons of the 2 Play versions:&amp;lt;ref&amp;gt;http://stackoverflow.com/questions/8189893/what-are-the-major-differences-between-play-framework-1-0-and-2-0&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Involves Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Inversion of Control&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87827</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87827"/>
		<updated>2014-09-20T03:56:23Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* Features of Play Framework */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt; It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&amp;lt;ref&amp;gt;http://www.reactivemanifesto.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
[[File:rsz_play-logo1_-_copy.png|293px|thumb|right|Play framework© logo]]&lt;br /&gt;
==Motivation==&lt;br /&gt;
*To create a stateless web framework&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*To have an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*To provide full-stack web framework&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with Ebean by default with the option to use any other persistence mechanism. [http://en.wikipedia.org/wiki/JUnit  JUnit], Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*To provide a developer friendly feature driven framework&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework#Motivation&amp;lt;/ref&amp;gt;&lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to [http://en.wikipedia.org/wiki/JSON JSON] and integration of compilers for CoffeeScript, LESS etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, RESTful by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play makes use of [http://en.wikipedia.org/wiki/Akka_(toolkit) Akka] which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. [http://en.wikipedia.org/wiki/Netty_(software) Netty] supports non - blocking I/O and hence it is not expensive to make such calls.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt; The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History=== &lt;br /&gt;
&lt;br /&gt;
Below is the changes introduced in the releases: &amp;lt;ref&amp;gt;https://www.playframework.com/changelog&amp;lt;/ref&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/1.0/main&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. The model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory is the directory that imparts the feature of configuration-over-convention to the framework. It contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
Play.application().configuration().getInt(&amp;quot;number&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Compilation Errors===&lt;br /&gt;
The Play framework provides a hot deployment functionality. It means that code need not be compiled before deployment on the server. The developer can write the piece of code and directly hit refresh to execute the code. The compilation and execution happens at the time of deployment. Compilation errors, if any, are directly shown on the browser screen.&lt;br /&gt;
&lt;br /&gt;
Since, compilation and packaging happen at the time of deployment, Play does not have an elaborate development cycle. Although, two distinctive server modes are supported by Play. The '''DEV''' mode to be used for development purposes and the '''PROD''' mode when application is deployed. The main difference between the two modes is that hot reloading is not supported in the production mode.&lt;br /&gt;
&lt;br /&gt;
===IDE Support===&lt;br /&gt;
Since Play supports hot reloading, code can be typed on the fly and output can be received on the browser screen. Since there is no specific compilation phase involved, coding on Play framework does not require a [http://en.wikipedia.org/wiki/Integrated_development_environment, Integrated Development Environment (IDE)]&lt;br /&gt;
Although code writing would not require the maximum usage of the IDE, activities like debugging and assisted refractoring in Java and Scala require the use of these sophisticated tools.&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/2.4.x/IDE&amp;lt;/ref&amp;gt;&lt;br /&gt;
Play framework supports a host of famous IDE's like:&lt;br /&gt;
*Eclipse&lt;br /&gt;
A simple command &amp;lt;code&amp;gt;eclipsify&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;eclipse&amp;lt;/code&amp;gt; generates the required Eclipse configurations to convert the existing application to an Eclipse-ready one.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[my-first-play-app] $ eclipse&lt;br /&gt;
[my-first-play-app] $ eclipsify&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*IntelliJ&lt;br /&gt;
This IDE does not require a command prompt to setup the project configurations. It provides a direct Play2.x project selection while creating a new project. Only perquisite is that the Scala and Play 2 plugins are enabled in the IDE.&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors, which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel.&lt;br /&gt;
&lt;br /&gt;
Below is the sample creation of code: &amp;lt;ref&amp;gt;http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above actor &amp;lt;code&amp;gt;MyActor&amp;lt;/code&amp;gt; can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file.&lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
&lt;br /&gt;
The following is a summary of the pros and cons of the 2 Play versions:&amp;lt;ref&amp;gt;http://stackoverflow.com/questions/8189893/what-are-the-major-differences-between-play-framework-1-0-and-2-0&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Involves Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Inversion of Control&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87826</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87826"/>
		<updated>2014-09-20T03:54:43Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* Features of Play Framework */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt; It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&amp;lt;ref&amp;gt;http://www.reactivemanifesto.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
[[File:rsz_play-logo1_-_copy.png|293px|thumb|right|Play framework© logo]]&lt;br /&gt;
==Motivation==&lt;br /&gt;
*To create a stateless web framework&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*To have an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*To provide full-stack web framework&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with Ebean by default with the option to use any other persistence mechanism. [http://en.wikipedia.org/wiki/JUnit  JUnit], Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*To provide a developer friendly feature driven framework&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework#Motivation&amp;lt;/ref&amp;gt;&lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to [http://en.wikipedia.org/wiki/JSON JSON] and integration of compilers for CoffeeScript, LESS etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, RESTful by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play makes use of [http://en.wikipedia.org/wiki/Akka_(toolkit) Akka] which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. Netty supports non - blocking I/O and hence it is not expensive to make such calls.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt; The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History=== &lt;br /&gt;
&lt;br /&gt;
Below is the changes introduced in the releases: &amp;lt;ref&amp;gt;https://www.playframework.com/changelog&amp;lt;/ref&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/1.0/main&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. The model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory is the directory that imparts the feature of configuration-over-convention to the framework. It contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
Play.application().configuration().getInt(&amp;quot;number&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Compilation Errors===&lt;br /&gt;
The Play framework provides a hot deployment functionality. It means that code need not be compiled before deployment on the server. The developer can write the piece of code and directly hit refresh to execute the code. The compilation and execution happens at the time of deployment. Compilation errors, if any, are directly shown on the browser screen.&lt;br /&gt;
&lt;br /&gt;
Since, compilation and packaging happen at the time of deployment, Play does not have an elaborate development cycle. Although, two distinctive server modes are supported by Play. The '''DEV''' mode to be used for development purposes and the '''PROD''' mode when application is deployed. The main difference between the two modes is that hot reloading is not supported in the production mode.&lt;br /&gt;
&lt;br /&gt;
===IDE Support===&lt;br /&gt;
Since Play supports hot reloading, code can be typed on the fly and output can be received on the browser screen. Since there is no specific compilation phase involved, coding on Play framework does not require a [http://en.wikipedia.org/wiki/Integrated_development_environment, Integrated Development Environment (IDE)]&lt;br /&gt;
Although code writing would not require the maximum usage of the IDE, activities like debugging and assisted refractoring in Java and Scala require the use of these sophisticated tools.&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/2.4.x/IDE&amp;lt;/ref&amp;gt;&lt;br /&gt;
Play framework supports a host of famous IDE's like:&lt;br /&gt;
*Eclipse&lt;br /&gt;
A simple command &amp;lt;code&amp;gt;eclipsify&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;eclipse&amp;lt;/code&amp;gt; generates the required Eclipse configurations to convert the existing application to an Eclipse-ready one.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[my-first-play-app] $ eclipse&lt;br /&gt;
[my-first-play-app] $ eclipsify&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*IntelliJ&lt;br /&gt;
This IDE does not require a command prompt to setup the project configurations. It provides a direct Play2.x project selection while creating a new project. Only perquisite is that the Scala and Play 2 plugins are enabled in the IDE.&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors, which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel.&lt;br /&gt;
&lt;br /&gt;
Below is the sample creation of code: &amp;lt;ref&amp;gt;http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above actor &amp;lt;code&amp;gt;MyActor&amp;lt;/code&amp;gt; can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file.&lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
&lt;br /&gt;
The following is a summary of the pros and cons of the 2 Play versions:&amp;lt;ref&amp;gt;http://stackoverflow.com/questions/8189893/what-are-the-major-differences-between-play-framework-1-0-and-2-0&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Involves Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Inversion of Control&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87825</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87825"/>
		<updated>2014-09-20T03:54:06Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* Motivation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt; It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&amp;lt;ref&amp;gt;http://www.reactivemanifesto.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
[[File:rsz_play-logo1_-_copy.png|293px|thumb|right|Play framework© logo]]&lt;br /&gt;
==Motivation==&lt;br /&gt;
*To create a stateless web framework&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*To have an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*To provide full-stack web framework&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with Ebean by default with the option to use any other persistence mechanism. [http://en.wikipedia.org/wiki/JUnit  JUnit], Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*To provide a developer friendly feature driven framework&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework#Motivation&amp;lt;/ref&amp;gt;&lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to [http://en.wikipedia.org/wiki/JSON JSON] and integration of compilers for CoffeeScript, LESS etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, RESTful by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play makes use of [http://en.wikipedia.org/wiki/Akka_(toolkit), Akka] which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. Netty supports non - blocking I/O and hence it is not expensive to make such calls.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt; The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History=== &lt;br /&gt;
&lt;br /&gt;
Below is the changes introduced in the releases: &amp;lt;ref&amp;gt;https://www.playframework.com/changelog&amp;lt;/ref&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/1.0/main&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. The model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory is the directory that imparts the feature of configuration-over-convention to the framework. It contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
Play.application().configuration().getInt(&amp;quot;number&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Compilation Errors===&lt;br /&gt;
The Play framework provides a hot deployment functionality. It means that code need not be compiled before deployment on the server. The developer can write the piece of code and directly hit refresh to execute the code. The compilation and execution happens at the time of deployment. Compilation errors, if any, are directly shown on the browser screen.&lt;br /&gt;
&lt;br /&gt;
Since, compilation and packaging happen at the time of deployment, Play does not have an elaborate development cycle. Although, two distinctive server modes are supported by Play. The '''DEV''' mode to be used for development purposes and the '''PROD''' mode when application is deployed. The main difference between the two modes is that hot reloading is not supported in the production mode.&lt;br /&gt;
&lt;br /&gt;
===IDE Support===&lt;br /&gt;
Since Play supports hot reloading, code can be typed on the fly and output can be received on the browser screen. Since there is no specific compilation phase involved, coding on Play framework does not require a [http://en.wikipedia.org/wiki/Integrated_development_environment, Integrated Development Environment (IDE)]&lt;br /&gt;
Although code writing would not require the maximum usage of the IDE, activities like debugging and assisted refractoring in Java and Scala require the use of these sophisticated tools.&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/2.4.x/IDE&amp;lt;/ref&amp;gt;&lt;br /&gt;
Play framework supports a host of famous IDE's like:&lt;br /&gt;
*Eclipse&lt;br /&gt;
A simple command &amp;lt;code&amp;gt;eclipsify&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;eclipse&amp;lt;/code&amp;gt; generates the required Eclipse configurations to convert the existing application to an Eclipse-ready one.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[my-first-play-app] $ eclipse&lt;br /&gt;
[my-first-play-app] $ eclipsify&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*IntelliJ&lt;br /&gt;
This IDE does not require a command prompt to setup the project configurations. It provides a direct Play2.x project selection while creating a new project. Only perquisite is that the Scala and Play 2 plugins are enabled in the IDE.&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors, which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel.&lt;br /&gt;
&lt;br /&gt;
Below is the sample creation of code: &amp;lt;ref&amp;gt;http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above actor &amp;lt;code&amp;gt;MyActor&amp;lt;/code&amp;gt; can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file.&lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
&lt;br /&gt;
The following is a summary of the pros and cons of the 2 Play versions:&amp;lt;ref&amp;gt;http://stackoverflow.com/questions/8189893/what-are-the-major-differences-between-play-framework-1-0-and-2-0&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Involves Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Inversion of Control&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87824</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87824"/>
		<updated>2014-09-20T03:53:29Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* Motivation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt; It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&amp;lt;ref&amp;gt;http://www.reactivemanifesto.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
[[File:rsz_play-logo1_-_copy.png|293px|thumb|right|Play framework© logo]]&lt;br /&gt;
==Motivation==&lt;br /&gt;
*To create a stateless web framework&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*To have an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*To provide full-stack web framework&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with Ebean by default with the option to use any other persistence mechanism. [http://en.wikipedia.org/wiki/JUnit , JUnit], Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*To provide a developer friendly feature driven framework&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework#Motivation&amp;lt;/ref&amp;gt;&lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to [http://en.wikipedia.org/wiki/JSON, JSON] and integration of compilers for CoffeeScript, LESS etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, RESTful by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play makes use of [http://en.wikipedia.org/wiki/Akka_(toolkit), Akka] which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. Netty supports non - blocking I/O and hence it is not expensive to make such calls.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt; The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History=== &lt;br /&gt;
&lt;br /&gt;
Below is the changes introduced in the releases: &amp;lt;ref&amp;gt;https://www.playframework.com/changelog&amp;lt;/ref&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/1.0/main&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. The model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory is the directory that imparts the feature of configuration-over-convention to the framework. It contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
Play.application().configuration().getInt(&amp;quot;number&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Compilation Errors===&lt;br /&gt;
The Play framework provides a hot deployment functionality. It means that code need not be compiled before deployment on the server. The developer can write the piece of code and directly hit refresh to execute the code. The compilation and execution happens at the time of deployment. Compilation errors, if any, are directly shown on the browser screen.&lt;br /&gt;
&lt;br /&gt;
Since, compilation and packaging happen at the time of deployment, Play does not have an elaborate development cycle. Although, two distinctive server modes are supported by Play. The '''DEV''' mode to be used for development purposes and the '''PROD''' mode when application is deployed. The main difference between the two modes is that hot reloading is not supported in the production mode.&lt;br /&gt;
&lt;br /&gt;
===IDE Support===&lt;br /&gt;
Since Play supports hot reloading, code can be typed on the fly and output can be received on the browser screen. Since there is no specific compilation phase involved, coding on Play framework does not require a [http://en.wikipedia.org/wiki/Integrated_development_environment, Integrated Development Environment (IDE)]&lt;br /&gt;
Although code writing would not require the maximum usage of the IDE, activities like debugging and assisted refractoring in Java and Scala require the use of these sophisticated tools.&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/2.4.x/IDE&amp;lt;/ref&amp;gt;&lt;br /&gt;
Play framework supports a host of famous IDE's like:&lt;br /&gt;
*Eclipse&lt;br /&gt;
A simple command &amp;lt;code&amp;gt;eclipsify&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;eclipse&amp;lt;/code&amp;gt; generates the required Eclipse configurations to convert the existing application to an Eclipse-ready one.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[my-first-play-app] $ eclipse&lt;br /&gt;
[my-first-play-app] $ eclipsify&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*IntelliJ&lt;br /&gt;
This IDE does not require a command prompt to setup the project configurations. It provides a direct Play2.x project selection while creating a new project. Only perquisite is that the Scala and Play 2 plugins are enabled in the IDE.&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors, which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel.&lt;br /&gt;
&lt;br /&gt;
Below is the sample creation of code: &amp;lt;ref&amp;gt;http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above actor &amp;lt;code&amp;gt;MyActor&amp;lt;/code&amp;gt; can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file.&lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
&lt;br /&gt;
The following is a summary of the pros and cons of the 2 Play versions:&amp;lt;ref&amp;gt;http://stackoverflow.com/questions/8189893/what-are-the-major-differences-between-play-framework-1-0-and-2-0&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Involves Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Inversion of Control&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87823</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87823"/>
		<updated>2014-09-20T03:52:38Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* Features of Play Framework */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt; It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&amp;lt;ref&amp;gt;http://www.reactivemanifesto.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
[[File:rsz_play-logo1_-_copy.png|293px|thumb|right|Play framework© logo]]&lt;br /&gt;
==Motivation==&lt;br /&gt;
*To create a stateless web framework&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*To have an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*To provide full-stack web framework&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with Ebean by default with the option to use any other persistence mechanism. [http://en.wikipedia.org/wiki/JUnit, JUnit], Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*To provide a developer friendly feature driven framework&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework#Motivation&amp;lt;/ref&amp;gt;&lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to [http://en.wikipedia.org/wiki/JSON, JSON] and integration of compilers for CoffeeScript, LESS etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, RESTful by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play makes use of [http://en.wikipedia.org/wiki/Akka_(toolkit), Akka] which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. Netty supports non - blocking I/O and hence it is not expensive to make such calls.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt; The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History=== &lt;br /&gt;
&lt;br /&gt;
Below is the changes introduced in the releases: &amp;lt;ref&amp;gt;https://www.playframework.com/changelog&amp;lt;/ref&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/1.0/main&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. The model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory is the directory that imparts the feature of configuration-over-convention to the framework. It contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
Play.application().configuration().getInt(&amp;quot;number&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Compilation Errors===&lt;br /&gt;
The Play framework provides a hot deployment functionality. It means that code need not be compiled before deployment on the server. The developer can write the piece of code and directly hit refresh to execute the code. The compilation and execution happens at the time of deployment. Compilation errors, if any, are directly shown on the browser screen.&lt;br /&gt;
&lt;br /&gt;
Since, compilation and packaging happen at the time of deployment, Play does not have an elaborate development cycle. Although, two distinctive server modes are supported by Play. The '''DEV''' mode to be used for development purposes and the '''PROD''' mode when application is deployed. The main difference between the two modes is that hot reloading is not supported in the production mode.&lt;br /&gt;
&lt;br /&gt;
===IDE Support===&lt;br /&gt;
Since Play supports hot reloading, code can be typed on the fly and output can be received on the browser screen. Since there is no specific compilation phase involved, coding on Play framework does not require a [http://en.wikipedia.org/wiki/Integrated_development_environment, Integrated Development Environment (IDE)]&lt;br /&gt;
Although code writing would not require the maximum usage of the IDE, activities like debugging and assisted refractoring in Java and Scala require the use of these sophisticated tools.&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/2.4.x/IDE&amp;lt;/ref&amp;gt;&lt;br /&gt;
Play framework supports a host of famous IDE's like:&lt;br /&gt;
*Eclipse&lt;br /&gt;
A simple command &amp;lt;code&amp;gt;eclipsify&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;eclipse&amp;lt;/code&amp;gt; generates the required Eclipse configurations to convert the existing application to an Eclipse-ready one.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[my-first-play-app] $ eclipse&lt;br /&gt;
[my-first-play-app] $ eclipsify&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*IntelliJ&lt;br /&gt;
This IDE does not require a command prompt to setup the project configurations. It provides a direct Play2.x project selection while creating a new project. Only perquisite is that the Scala and Play 2 plugins are enabled in the IDE.&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors, which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel.&lt;br /&gt;
&lt;br /&gt;
Below is the sample creation of code: &amp;lt;ref&amp;gt;http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above actor &amp;lt;code&amp;gt;MyActor&amp;lt;/code&amp;gt; can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file.&lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
&lt;br /&gt;
The following is a summary of the pros and cons of the 2 Play versions:&amp;lt;ref&amp;gt;http://stackoverflow.com/questions/8189893/what-are-the-major-differences-between-play-framework-1-0-and-2-0&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Involves Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Inversion of Control&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87822</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87822"/>
		<updated>2014-09-20T03:51:28Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* Motivation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt; It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&amp;lt;ref&amp;gt;http://www.reactivemanifesto.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
[[File:rsz_play-logo1_-_copy.png|293px|thumb|right|Play framework© logo]]&lt;br /&gt;
==Motivation==&lt;br /&gt;
*To create a stateless web framework&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*To have an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*To provide full-stack web framework&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with Ebean by default with the option to use any other persistence mechanism. [http://en.wikipedia.org/wiki/JUnit, JUnit], Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*To provide a developer friendly feature driven framework&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework#Motivation&amp;lt;/ref&amp;gt;&lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to [http://en.wikipedia.org/wiki/JSON, JSON] and integration of compilers for CoffeeScript, LESS etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, RESTful by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play makes use of Akka which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. Netty supports non - blocking I/O and hence it is not expensive to make such calls.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt; The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History=== &lt;br /&gt;
&lt;br /&gt;
Below is the changes introduced in the releases: &amp;lt;ref&amp;gt;https://www.playframework.com/changelog&amp;lt;/ref&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/1.0/main&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. The model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory is the directory that imparts the feature of configuration-over-convention to the framework. It contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
Play.application().configuration().getInt(&amp;quot;number&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Compilation Errors===&lt;br /&gt;
The Play framework provides a hot deployment functionality. It means that code need not be compiled before deployment on the server. The developer can write the piece of code and directly hit refresh to execute the code. The compilation and execution happens at the time of deployment. Compilation errors, if any, are directly shown on the browser screen.&lt;br /&gt;
&lt;br /&gt;
Since, compilation and packaging happen at the time of deployment, Play does not have an elaborate development cycle. Although, two distinctive server modes are supported by Play. The '''DEV''' mode to be used for development purposes and the '''PROD''' mode when application is deployed. The main difference between the two modes is that hot reloading is not supported in the production mode.&lt;br /&gt;
&lt;br /&gt;
===IDE Support===&lt;br /&gt;
Since Play supports hot reloading, code can be typed on the fly and output can be received on the browser screen. Since there is no specific compilation phase involved, coding on Play framework does not require a [http://en.wikipedia.org/wiki/Integrated_development_environment, Integrated Development Environment (IDE)]&lt;br /&gt;
Although code writing would not require the maximum usage of the IDE, activities like debugging and assisted refractoring in Java and Scala require the use of these sophisticated tools.&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/2.4.x/IDE&amp;lt;/ref&amp;gt;&lt;br /&gt;
Play framework supports a host of famous IDE's like:&lt;br /&gt;
*Eclipse&lt;br /&gt;
A simple command &amp;lt;code&amp;gt;eclipsify&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;eclipse&amp;lt;/code&amp;gt; generates the required Eclipse configurations to convert the existing application to an Eclipse-ready one.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[my-first-play-app] $ eclipse&lt;br /&gt;
[my-first-play-app] $ eclipsify&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*IntelliJ&lt;br /&gt;
This IDE does not require a command prompt to setup the project configurations. It provides a direct Play2.x project selection while creating a new project. Only perquisite is that the Scala and Play 2 plugins are enabled in the IDE.&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors, which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel.&lt;br /&gt;
&lt;br /&gt;
Below is the sample creation of code: &amp;lt;ref&amp;gt;http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above actor &amp;lt;code&amp;gt;MyActor&amp;lt;/code&amp;gt; can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file.&lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
&lt;br /&gt;
The following is a summary of the pros and cons of the 2 Play versions:&amp;lt;ref&amp;gt;http://stackoverflow.com/questions/8189893/what-are-the-major-differences-between-play-framework-1-0-and-2-0&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Involves Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Inversion of Control&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87819</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87819"/>
		<updated>2014-09-20T03:49:19Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* Asynchronous and Scalable programming */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt; It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&amp;lt;ref&amp;gt;http://www.reactivemanifesto.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
[[File:rsz_play-logo1_-_copy.png|293px|thumb|right|Play framework© logo]]&lt;br /&gt;
==Motivation==&lt;br /&gt;
*To create a stateless web framework&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*To have an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*To provide full-stack web framework&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with Ebean by default with the option to use any other persistence mechanism. JUnit, Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*To provide a developer friendly feature driven framework&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework#Motivation&amp;lt;/ref&amp;gt;&lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to JSON and integration of compilers for CoffeeScript, LESS etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, RESTful by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play makes use of Akka which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. Netty supports non - blocking I/O and hence it is not expensive to make such calls.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt; The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History=== &lt;br /&gt;
&lt;br /&gt;
Below is the changes introduced in the releases: &amp;lt;ref&amp;gt;https://www.playframework.com/changelog&amp;lt;/ref&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/1.0/main&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. The model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory is the directory that imparts the feature of configuration-over-convention to the framework. It contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
Play.application().configuration().getInt(&amp;quot;number&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Compilation Errors===&lt;br /&gt;
The Play framework provides a hot deployment functionality. It means that code need not be compiled before deployment on the server. The developer can write the piece of code and directly hit refresh to execute the code. The compilation and execution happens at the time of deployment. Compilation errors, if any, are directly shown on the browser screen.&lt;br /&gt;
&lt;br /&gt;
Since, compilation and packaging happen at the time of deployment, Play does not have an elaborate development cycle. Although, two distinctive server modes are supported by Play. The '''DEV''' mode to be used for development purposes and the '''PROD''' mode when application is deployed. The main difference between the two modes is that hot reloading is not supported in the production mode.&lt;br /&gt;
&lt;br /&gt;
===IDE Support===&lt;br /&gt;
Since Play supports hot reloading, code can be typed on the fly and output can be received on the browser screen. Since there is no specific compilation phase involved, coding on Play framework does not require a [http://en.wikipedia.org/wiki/Integrated_development_environment, Integrated Development Environment (IDE)]&lt;br /&gt;
Although code writing would not require the maximum usage of the IDE, activities like debugging and assisted refractoring in Java and Scala require the use of these sophisticated tools.&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/2.4.x/IDE&amp;lt;/ref&amp;gt;&lt;br /&gt;
Play framework supports a host of famous IDE's like:&lt;br /&gt;
*Eclipse&lt;br /&gt;
A simple command &amp;lt;code&amp;gt;eclipsify&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;eclipse&amp;lt;/code&amp;gt; generates the required Eclipse configurations to convert the existing application to an Eclipse-ready one.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[my-first-play-app] $ eclipse&lt;br /&gt;
[my-first-play-app] $ eclipsify&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*IntelliJ&lt;br /&gt;
This IDE does not require a command prompt to setup the project configurations. It provides a direct Play2.x project selection while creating a new project. Only perquisite is that the Scala and Play 2 plugins are enabled in the IDE.&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors, which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel.&lt;br /&gt;
&lt;br /&gt;
Below is the sample creation of code: &amp;lt;ref&amp;gt;http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above actor &amp;lt;code&amp;gt;MyActor&amp;lt;/code&amp;gt; can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file.&lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
&lt;br /&gt;
The following is a summary of the pros and cons of the 2 Play versions:&amp;lt;ref&amp;gt;http://stackoverflow.com/questions/8189893/what-are-the-major-differences-between-play-framework-1-0-and-2-0&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Involves Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Inversion of Control&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87818</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87818"/>
		<updated>2014-09-20T03:48:17Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* IDE Support */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt; It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&amp;lt;ref&amp;gt;http://www.reactivemanifesto.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
[[File:rsz_play-logo1_-_copy.png|293px|thumb|right|Play framework© logo]]&lt;br /&gt;
==Motivation==&lt;br /&gt;
*To create a stateless web framework&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*To have an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*To provide full-stack web framework&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with Ebean by default with the option to use any other persistence mechanism. JUnit, Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*To provide a developer friendly feature driven framework&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework#Motivation&amp;lt;/ref&amp;gt;&lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to JSON and integration of compilers for CoffeeScript, LESS etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, RESTful by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play makes use of Akka which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. Netty supports non - blocking I/O and hence it is not expensive to make such calls.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt; The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History=== &lt;br /&gt;
&lt;br /&gt;
Below is the changes introduced in the releases: &amp;lt;ref&amp;gt;https://www.playframework.com/changelog&amp;lt;/ref&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/1.0/main&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. The model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory is the directory that imparts the feature of configuration-over-convention to the framework. It contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
Play.application().configuration().getInt(&amp;quot;number&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Compilation Errors===&lt;br /&gt;
The Play framework provides a hot deployment functionality. It means that code need not be compiled before deployment on the server. The developer can write the piece of code and directly hit refresh to execute the code. The compilation and execution happens at the time of deployment. Compilation errors, if any, are directly shown on the browser screen.&lt;br /&gt;
&lt;br /&gt;
Since, compilation and packaging happen at the time of deployment, Play does not have an elaborate development cycle. Although, two distinctive server modes are supported by Play. The '''DEV''' mode to be used for development purposes and the '''PROD''' mode when application is deployed. The main difference between the two modes is that hot reloading is not supported in the production mode.&lt;br /&gt;
&lt;br /&gt;
===IDE Support===&lt;br /&gt;
Since Play supports hot reloading, code can be typed on the fly and output can be received on the browser screen. Since there is no specific compilation phase involved, coding on Play framework does not require a [http://en.wikipedia.org/wiki/Integrated_development_environment, Integrated Development Environment (IDE)]&lt;br /&gt;
Although code writing would not require the maximum usage of the IDE, activities like debugging and assisted refractoring in Java and Scala require the use of these sophisticated tools.&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/2.4.x/IDE&amp;lt;/ref&amp;gt;&lt;br /&gt;
Play framework supports a host of famous IDE's like:&lt;br /&gt;
*Eclipse&lt;br /&gt;
A simple command &amp;lt;code&amp;gt;eclipsify&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;eclipse&amp;lt;/code&amp;gt; generates the required Eclipse configurations to convert the existing application to an Eclipse-ready one.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[my-first-play-app] $ eclipse&lt;br /&gt;
[my-first-play-app] $ eclipsify&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*IntelliJ&lt;br /&gt;
This IDE does not require a command prompt to setup the project configurations. It provides a direct Play2.x project selection while creating a new project. Only perquisite is that the Scala and Play 2 plugins are enabled in the IDE.&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors ,which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel.&lt;br /&gt;
&lt;br /&gt;
Below is the sample creation of code: &amp;lt;ref&amp;gt;http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above actor &amp;lt;code&amp;gt;MyActor&amp;lt;/code&amp;gt; can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file.  &lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
&lt;br /&gt;
The following is a summary of the pros and cons of the 2 Play versions:&amp;lt;ref&amp;gt;http://stackoverflow.com/questions/8189893/what-are-the-major-differences-between-play-framework-1-0-and-2-0&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Involves Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Inversion of Control&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87817</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87817"/>
		<updated>2014-09-20T03:45:55Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* IDE Support */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt; It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&amp;lt;ref&amp;gt;http://www.reactivemanifesto.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
[[File:rsz_play-logo1_-_copy.png|293px|thumb|right|Play framework© logo]]&lt;br /&gt;
==Motivation==&lt;br /&gt;
*To create a stateless web framework&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*To have an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*To provide full-stack web framework&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with Ebean by default with the option to use any other persistence mechanism. JUnit, Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*To provide a developer friendly feature driven framework&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework#Motivation&amp;lt;/ref&amp;gt;&lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to JSON and integration of compilers for CoffeeScript, LESS etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, RESTful by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play makes use of Akka which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. Netty supports non - blocking I/O and hence it is not expensive to make such calls.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt; The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History=== &lt;br /&gt;
&lt;br /&gt;
Below is the changes introduced in the releases: &amp;lt;ref&amp;gt;https://www.playframework.com/changelog&amp;lt;/ref&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/1.0/main&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. The model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory is the directory that imparts the feature of configuration-over-convention to the framework. It contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
Play.application().configuration().getInt(&amp;quot;number&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Compilation Errors===&lt;br /&gt;
The Play framework provides a hot deployment functionality. It means that code need not be compiled before deployment on the server. The developer can write the piece of code and directly hit refresh to execute the code. The compilation and execution happens at the time of deployment. Compilation errors, if any, are directly shown on the browser screen.&lt;br /&gt;
&lt;br /&gt;
Since, compilation and packaging happen at the time of deployment, Play does not have an elaborate development cycle. Although, two distinctive server modes are supported by Play. The '''DEV''' mode to be used for development purposes and the '''PROD''' mode when application is deployed. The main difference between the two modes is that hot reloading is not supported in the production mode.&lt;br /&gt;
&lt;br /&gt;
===IDE Support===&lt;br /&gt;
Since Play supports hot reloading, code can be typed on the fly and output can be received on the browser screen. Since there is no specific compilation phase involved, coding on Play framework does not require a Integrated Development Environment (IDE) [http://en.wikipedia.org/wiki/Integrated_development_environment]&lt;br /&gt;
Although code writing would not require the maximum usage of the IDE, activities like debugging and assisted refractoring in Java and Scala require the use of these sophisticated tools.&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/2.4.x/IDE&amp;lt;/ref&amp;gt;&lt;br /&gt;
Play framework supports a host of famous IDE's like:&lt;br /&gt;
*Eclipse&lt;br /&gt;
A simple command &amp;lt;code&amp;gt;eclipsify&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;eclipse&amp;lt;/code&amp;gt; generates the required Eclipse configurations to convert the existing application to an Eclipse-ready one.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[my-first-play-app] $ eclipse&lt;br /&gt;
[my-first-play-app] $ eclipsify&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*IntelliJ&lt;br /&gt;
This IDE does not require a command prompt to setup the project configurations. It provides a direct Play2.x project selection while creating a new project. Only perquisite is that the Scala and Play 2 plugins are enabled in the IDE.&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors ,which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel.&lt;br /&gt;
&lt;br /&gt;
Below is the sample creation of code: &amp;lt;ref&amp;gt;http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above actor &amp;lt;code&amp;gt;MyActor&amp;lt;/code&amp;gt; can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file.  &lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
&lt;br /&gt;
The following is a summary of the pros and cons of the 2 Play versions:&amp;lt;ref&amp;gt;http://stackoverflow.com/questions/8189893/what-are-the-major-differences-between-play-framework-1-0-and-2-0&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Involves Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Inversion of Control&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87816</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87816"/>
		<updated>2014-09-20T03:43:55Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* Backward compatibility */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt; It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&amp;lt;ref&amp;gt;http://www.reactivemanifesto.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
[[File:rsz_play-logo1_-_copy.png|293px|thumb|right|Play framework© logo]]&lt;br /&gt;
==Motivation==&lt;br /&gt;
*To create a stateless web framework&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*To have an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*To provide full-stack web framework&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with Ebean by default with the option to use any other persistence mechanism. JUnit, Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*To provide a developer friendly feature driven framework&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework#Motivation&amp;lt;/ref&amp;gt;&lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to JSON and integration of compilers for CoffeeScript, LESS etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, RESTful by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play makes use of Akka which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. Netty supports non - blocking I/O and hence it is not expensive to make such calls.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt; The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History=== &lt;br /&gt;
&lt;br /&gt;
Below is the changes introduced in the releases: &amp;lt;ref&amp;gt;https://www.playframework.com/changelog&amp;lt;/ref&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/1.0/main&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. The model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory is the directory that imparts the feature of configuration-over-convention to the framework. It contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
Play.application().configuration().getInt(&amp;quot;number&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Compilation Errors===&lt;br /&gt;
The Play framework provides a hot deployment functionality. It means that code need not be compiled before deployment on the server. The developer can write the piece of code and directly hit refresh to execute the code. The compilation and execution happens at the time of deployment. Compilation errors, if any, are directly shown on the browser screen.&lt;br /&gt;
&lt;br /&gt;
Since, compilation and packaging happen at the time of deployment, Play does not have an elaborate development cycle. Although, two distinctive server modes are supported by Play. The '''DEV''' mode to be used for development purposes and the '''PROD''' mode when application is deployed. The main difference between the two modes is that hot reloading is not supported in the production mode.&lt;br /&gt;
&lt;br /&gt;
===IDE Support===&lt;br /&gt;
Since Play supports hot reloading, code can be typed on the fly and output can be received on the browser screen. Since there is no specific compilation phase involved, coding on Play framework does not require a [Integrated Development Environment (IDE) http://en.wikipedia.org/wiki/Integrated_development_environment]&lt;br /&gt;
Although code writing would not require the maximum usage of the IDE, activities like debugging and assisted refractoring in Java and Scala require the use of these sophisticated tools.&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/2.4.x/IDE&amp;lt;/ref&amp;gt;&lt;br /&gt;
Play framework supports a host of famous IDE's like:&lt;br /&gt;
*Eclipse&lt;br /&gt;
A simple command &amp;lt;code&amp;gt;eclipsify&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;eclipse&amp;lt;/code&amp;gt; generates the required Eclipse configurations to convert the existing application to an Eclipse-ready one.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[my-first-play-app] $ eclipse&lt;br /&gt;
[my-first-play-app] $ eclipsify&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*IntelliJ&lt;br /&gt;
This IDE does not require a command prompt to setup the project configurations. It provides a direct Play2.x project selection while creating a new project. Only perquisite is that the Scala and Play 2 plugins are enabled in the IDE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors ,which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel.&lt;br /&gt;
&lt;br /&gt;
Below is the sample creation of code: &amp;lt;ref&amp;gt;http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above actor &amp;lt;code&amp;gt;MyActor&amp;lt;/code&amp;gt; can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file.  &lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
&lt;br /&gt;
The following is a summary of the pros and cons of the 2 Play versions:&amp;lt;ref&amp;gt;http://stackoverflow.com/questions/8189893/what-are-the-major-differences-between-play-framework-1-0-and-2-0&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Involves Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Inversion of Control&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87815</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87815"/>
		<updated>2014-09-20T03:43:41Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* Backward compatibility */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt; It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&amp;lt;ref&amp;gt;http://www.reactivemanifesto.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
[[File:rsz_play-logo1_-_copy.png|293px|thumb|right|Play framework© logo]]&lt;br /&gt;
==Motivation==&lt;br /&gt;
*To create a stateless web framework&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*To have an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*To provide full-stack web framework&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with Ebean by default with the option to use any other persistence mechanism. JUnit, Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*To provide a developer friendly feature driven framework&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework#Motivation&amp;lt;/ref&amp;gt;&lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to JSON and integration of compilers for CoffeeScript, LESS etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, RESTful by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play makes use of Akka which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. Netty supports non - blocking I/O and hence it is not expensive to make such calls.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt; The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History=== &lt;br /&gt;
&lt;br /&gt;
Below is the changes introduced in the releases: &amp;lt;ref&amp;gt;https://www.playframework.com/changelog&amp;lt;/ref&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/1.0/main&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. The model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory is the directory that imparts the feature of configuration-over-convention to the framework. It contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
Play.application().configuration().getInt(&amp;quot;number&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Compilation Errors===&lt;br /&gt;
The Play framework provides a hot deployment functionality. It means that code need not be compiled before deployment on the server. The developer can write the piece of code and directly hit refresh to execute the code. The compilation and execution happens at the time of deployment. Compilation errors, if any, are directly shown on the browser screen.&lt;br /&gt;
&lt;br /&gt;
Since, compilation and packaging happen at the time of deployment, Play does not have an elaborate development cycle. Although, two distinctive server modes are supported by Play. The '''DEV''' mode to be used for development purposes and the '''PROD''' mode when application is deployed. The main difference between the two modes is that hot reloading is not supported in the production mode.&lt;br /&gt;
&lt;br /&gt;
===IDE Support===&lt;br /&gt;
Since Play supports hot reloading, code can be typed on the fly and output can be received on the browser screen. Since there is no specific compilation phase involved, coding on Play framework does not require a [Integrated Development Environment (IDE) http://en.wikipedia.org/wiki/Integrated_development_environment]&lt;br /&gt;
Although code writing would not require the maximum usage of the IDE, activities like debugging and assisted refractoring in Java and Scala require the use of these sophisticated tools.&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/2.4.x/IDE&amp;lt;/ref&amp;gt;&lt;br /&gt;
Play framework supports a host of famous IDE's like:&lt;br /&gt;
*Eclipse&lt;br /&gt;
A simple command &amp;lt;code&amp;gt;eclipsify&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;eclipse&amp;lt;/code&amp;gt; generates the required Eclipse configurations to convert the existing application to an Eclipse-ready one.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[my-first-play-app] $ eclipse&lt;br /&gt;
[my-first-play-app] $ eclipsify&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*IntelliJ&lt;br /&gt;
This IDE does not require a command prompt to setup the project configurations. It provides a direct Play2.x project selection while creating a new project. Only perquisite is that the Scala and Play 2 plugins are enabled in the IDE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors ,which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel.&lt;br /&gt;
&lt;br /&gt;
Below is the sample creation of code: &amp;lt;ref&amp;gt;http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above actor &amp;lt;code&amp;gt;MyActor&amp;lt;/code&amp;gt; can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file.  &lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
&lt;br /&gt;
The following is a summary of the pros and cons of the 2 Play versions:&amp;lt;ref&amp;gt;http://stackoverflow.com/questions/8189893/what-are-the-major-differences-between-play-framework-1-0-and-2-0&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Involves Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Inversion of Control&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Rsz_play-logo1_-_copy.png&amp;diff=87791</id>
		<title>File:Rsz play-logo1 - copy.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Rsz_play-logo1_-_copy.png&amp;diff=87791"/>
		<updated>2014-09-20T03:35:48Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: uploaded a new version of &amp;amp;quot;File:Rsz play-logo1 - copy.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Play Logo&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87787</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87787"/>
		<updated>2014-09-20T03:34:22Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt; It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&amp;lt;ref&amp;gt;http://www.reactivemanifesto.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
[[File:rsz_play-logo1_-_copy.png|293px|thumb|right|Play framework© logo]]&lt;br /&gt;
==Motivation==&lt;br /&gt;
*To create a stateless web framework&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*To have an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*To provide full-stack web framework&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with Ebean by default with the option to use any other persistence mechanism. JUnit, Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*To provide a developer friendly feature driven framework&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework#Motivation&amp;lt;/ref&amp;gt;&lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to JSON and integration of compilers for CoffeeScript, LESS etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, RESTful by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play makes use of Akka which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. Netty supports non - blocking I/O and hence it is not expensive to make such calls.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt; The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History=== &lt;br /&gt;
&lt;br /&gt;
Below is the changes introduced in the releases: &amp;lt;ref&amp;gt;https://www.playframework.com/changelog&amp;lt;/ref&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/1.0/main&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. The model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory is the directory that imparts the feature of configuration-over-convention to the framework. It contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
Play.application().configuration().getInt(&amp;quot;number&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Compilation Errors===&lt;br /&gt;
The Play framework provides a hot deployment functionality. It means that code need not be compiled before deployment on the server. The developer can write the piece of code and directly hit refresh to execute the code. The compilation and execution happens at the time of deployment. Compilation errors, if any, are directly shown on the browser screen.&lt;br /&gt;
&lt;br /&gt;
Since, compilation and packaging happen at the time of deployment, Play does not have an elaborate development cycle. Although, two distinctive server modes are supported by Play. The '''DEV''' mode to be used for development purposes and the '''PROD''' mode when application is deployed. The main difference between the two modes is that hot reloading is not supported in the production mode.&lt;br /&gt;
&lt;br /&gt;
===IDE Support===&lt;br /&gt;
Since Play supports hot reloading, code can be typed on the fly and output can be received on the browser screen. Since there is no specific compilation phase involved, coding on Play framework does not require a [Integrated Development Environment (IDE) http://en.wikipedia.org/wiki/Integrated_development_environment]&lt;br /&gt;
Although code writing would not require the maximum usage of the IDE, activities like debugging and assisted refractoring in Java and Scala require the use of these sophisticated tools.&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/2.4.x/IDE&amp;lt;/ref&amp;gt;&lt;br /&gt;
Play framework supports a host of famous IDE's like:&lt;br /&gt;
*Eclipse&lt;br /&gt;
A simple command &amp;lt;code&amp;gt;eclipsify&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;eclipse&amp;lt;/code&amp;gt; generates the required Eclipse configurations to convert the existing application to an Eclipse-ready one.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[my-first-play-app] $ eclipse&lt;br /&gt;
[my-first-play-app] $ eclipsify&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*IntelliJ&lt;br /&gt;
This IDE does not require a command prompt to setup the project configurations. It provides a direct Play2.x project selection while creating a new project. Only perquisite is that the Scala and Play 2 plugins are enabled in the IDE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors ,which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel.&lt;br /&gt;
&lt;br /&gt;
Below is the sample creation of code: &amp;lt;ref&amp;gt;http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above actor &amp;lt;code&amp;gt;MyActor&amp;lt;/code&amp;gt; can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file.  &lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
&lt;br /&gt;
The following is a summary of the pros and cons of the 2 Play versions:&amp;lt;ref&amp;gt;http://stackoverflow.com/questions/8189893/what-are-the-major-differences-between-play-framework-1-0-and-2-0&amp;lt;/ref&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Involves Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Inversion of Control&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87783</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87783"/>
		<updated>2014-09-20T03:33:17Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt; It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&amp;lt;ref&amp;gt;http://www.reactivemanifesto.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
[[File:rsz_play-logo1_-_copy.png|293px|thumb|right|alt text]]&lt;br /&gt;
==Motivation==&lt;br /&gt;
*To create a stateless web framework&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*To have an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*To provide full-stack web framework&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with Ebean by default with the option to use any other persistence mechanism. JUnit, Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*To provide a developer friendly feature driven framework&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework#Motivation&amp;lt;/ref&amp;gt;&lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to JSON and integration of compilers for CoffeeScript, LESS etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, RESTful by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play makes use of Akka which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. Netty supports non - blocking I/O and hence it is not expensive to make such calls.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt; The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History=== &lt;br /&gt;
&lt;br /&gt;
Below is the changes introduced in the releases: &amp;lt;ref&amp;gt;https://www.playframework.com/changelog&amp;lt;/ref&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/1.0/main&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. The model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory is the directory that imparts the feature of configuration-over-convention to the framework. It contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
Play.application().configuration().getInt(&amp;quot;number&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Compilation Errors===&lt;br /&gt;
The Play framework provides a hot deployment functionality. It means that code need not be compiled before deployment on the server. The developer can write the piece of code and directly hit refresh to execute the code. The compilation and execution happens at the time of deployment. Compilation errors, if any, are directly shown on the browser screen.&lt;br /&gt;
&lt;br /&gt;
Since, compilation and packaging happen at the time of deployment, Play does not have an elaborate development cycle. Although, two distinctive server modes are supported by Play. The '''DEV''' mode to be used for development purposes and the '''PROD''' mode when application is deployed. The main difference between the two modes is that hot reloading is not supported in the production mode.&lt;br /&gt;
&lt;br /&gt;
===IDE Support===&lt;br /&gt;
Since Play supports hot reloading, code can be typed on the fly and output can be received on the browser screen. Since there is no specific compilation phase involved, coding on Play framework does not require a [Integrated Development Environment (IDE) http://en.wikipedia.org/wiki/Integrated_development_environment]&lt;br /&gt;
Although code writing would not require the maximum usage of the IDE, activities like debugging and assisted refractoring in Java and Scala require the use of these sophisticated tools.&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/2.4.x/IDE&amp;lt;/ref&amp;gt;&lt;br /&gt;
Play framework supports a host of famous IDE's like:&lt;br /&gt;
*Eclipse&lt;br /&gt;
A simple command &amp;lt;code&amp;gt;eclipsify&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;eclipse&amp;lt;/code&amp;gt; generates the required Eclipse configurations to convert the existing application to an Eclipse-ready one.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[my-first-play-app] $ eclipse&lt;br /&gt;
[my-first-play-app] $ eclipsify&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*IntelliJ&lt;br /&gt;
This IDE does not require a command prompt to setup the project configurations. It provides a direct Play2.x project selection while creating a new project. Only perquisite is that the Scala and Play 2 plugins are enabled in the IDE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors ,which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel.&lt;br /&gt;
&lt;br /&gt;
Below is the sample creation of code: &amp;lt;ref&amp;gt;http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above actor &amp;lt;code&amp;gt;MyActor&amp;lt;/code&amp;gt; can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file.  &lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
&lt;br /&gt;
The following is a summary of the pros and cons of the 2 Play versions:&amp;lt;ref&amp;gt;http://stackoverflow.com/questions/8189893/what-are-the-major-differences-between-play-framework-1-0-and-2-0&amp;lt;/ref&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Involves Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Inversion of Control&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Rsz_play-logo1_-_copy.png&amp;diff=87781</id>
		<title>File:Rsz play-logo1 - copy.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Rsz_play-logo1_-_copy.png&amp;diff=87781"/>
		<updated>2014-09-20T03:31:59Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: Play Logo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Play Logo&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Play-logo1.png&amp;diff=87776</id>
		<title>File:Play-logo1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Play-logo1.png&amp;diff=87776"/>
		<updated>2014-09-20T03:22:52Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: Logo of Play&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Logo of Play&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Play-logo.png&amp;diff=87773</id>
		<title>File:Play-logo.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Play-logo.png&amp;diff=87773"/>
		<updated>2014-09-20T03:20:02Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: Logo of play&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Logo of play&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87767</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87767"/>
		<updated>2014-09-20T03:17:36Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt; It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&amp;lt;ref&amp;gt;http://www.reactivemanifesto.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
[[File:Play-logo.png|200px|thumb|right|alt text]]&lt;br /&gt;
==Motivation==&lt;br /&gt;
*To create a stateless web framework&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*To have an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*To provide full-stack web framework&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with Ebean by default with the option to use any other persistence mechanism. JUnit, Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*To provide a developer friendly feature driven framework&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework#Motivation&amp;lt;/ref&amp;gt;&lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to JSON and integration of compilers for CoffeeScript, LESS etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, RESTful by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play makes use of Akka which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. Netty supports non - blocking I/O and hence it is not expensive to make such calls.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt; The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History=== &lt;br /&gt;
&lt;br /&gt;
Below is the changes introduced in the releases: &amp;lt;ref&amp;gt;https://www.playframework.com/changelog&amp;lt;/ref&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/1.0/main&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. The model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory is the directory that imparts the feature of configuration-over-convention to the framework. It contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
Play.application().configuration().getInt(&amp;quot;number&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Compilation Errors===&lt;br /&gt;
The Play framework provides a hot deployment functionality. It means that code need not be compiled before deployment on the server. The developer can write the piece of code and directly hit refresh to execute the code. The compilation and execution happens at the time of deployment. Compilation errors, if any, are directly shown on the browser screen.&lt;br /&gt;
&lt;br /&gt;
Since, compilation and packaging happen at the time of deployment, Play does not have an elaborate development cycle. Although, two distinctive server modes are supported by Play. The '''DEV''' mode to be used for development purposes and the '''PROD''' mode when application is deployed. The main difference between the two modes is that hot reloading is not supported in the production mode.&lt;br /&gt;
&lt;br /&gt;
===IDE Support===&lt;br /&gt;
Since Play supports hot reloading, code can be typed on the fly and output can be received on the browser screen. Since there is no specific compilation phase involved, coding on Play framework does not require a [Integrated Development Environment (IDE) http://en.wikipedia.org/wiki/Integrated_development_environment]&lt;br /&gt;
Although code writing would not require the maximum usage of the IDE, activities like debugging and assisted refractoring in Java and Scala require the use of these sophisticated tools.&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/2.4.x/IDE&amp;lt;/ref&amp;gt;&lt;br /&gt;
Play framework supports a host of famous IDE's like:&lt;br /&gt;
*Eclipse&lt;br /&gt;
A simple command &amp;lt;code&amp;gt;eclipsify&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;eclipse&amp;lt;/code&amp;gt; generates the required Eclipse configurations to convert the existing application to an Eclipse-ready one.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[my-first-play-app] $ eclipse&lt;br /&gt;
[my-first-play-app] $ eclipsify&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*IntelliJ&lt;br /&gt;
This IDE does not require a command prompt to setup the project configurations. It provides a direct Play2.x project selection while creating a new project. Only perquisite is that the Scala and Play 2 plugins are enabled in the IDE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors ,which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel.&lt;br /&gt;
&lt;br /&gt;
Below is the sample creation of code: &amp;lt;ref&amp;gt;http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above actor &amp;lt;code&amp;gt;MyActor&amp;lt;/code&amp;gt; can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file.  &lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
&lt;br /&gt;
The following is a summary of the pros and cons of the 2 Play versions:&amp;lt;ref&amp;gt;http://stackoverflow.com/questions/8189893/what-are-the-major-differences-between-play-framework-1-0-and-2-0&amp;lt;/ref&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Involves Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Inversion of Control&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87727</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87727"/>
		<updated>2014-09-20T02:58:56Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* Backward compatibility */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt; It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&amp;lt;ref&amp;gt;http://www.reactivemanifesto.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
&lt;br /&gt;
==Motivation==&lt;br /&gt;
*To create a stateless web framework&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*To have an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*To provide full-stack web framework&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with Ebean by default with the option to use any other persistence mechanism. JUnit, Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*To provide a developer friendly feature driven framework&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework#Motivation&amp;lt;/ref&amp;gt;&lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to JSON and integration of compilers for CoffeeScript, LESS etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, RESTful by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play makes use of Akka which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. Netty supports non - blocking I/O and hence it is not expensive to make such calls.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt; The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History=== &lt;br /&gt;
&lt;br /&gt;
Below is the changes introduced in the releases: &amp;lt;ref&amp;gt;https://www.playframework.com/changelog&amp;lt;/ref&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/1.0/main&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. The model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory is the directory that imparts the feature of configuration-over-convention to the framework. It contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
Play.application().configuration().getInt(&amp;quot;number&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Compilation Errors===&lt;br /&gt;
The Play framework provides a hot deployment functionality. It means that code need not be compiled before deployment on the server. The developer can write the piece of code and directly hit refresh to execute the code. The compilation and execution happens at the time of deployment. Compilation errors, if any, are directly shown on the browser screen.&lt;br /&gt;
&lt;br /&gt;
Since, compilation and packaging happen at the time of deployment, Play does not have an elaborate development cycle. Although, two distinctive server modes are supported by Play. The '''DEV''' mode to be used for development purposes and the '''PROD''' mode when application is deployed. The main difference between the two modes is that hot reloading is not supported in the production mode.&lt;br /&gt;
&lt;br /&gt;
===IDE Support===&lt;br /&gt;
Since Play supports hot reloading, code can be typed on the fly and output can be received on the browser screen. Since there is no specific compilation phase involved, coding on Play framework does not require a [Integrated Development Environment (IDE) http://en.wikipedia.org/wiki/Integrated_development_environment]&lt;br /&gt;
Although code writing would not require the maximum usage of the IDE, activities like debugging and assisted refractoring in Java and Scala require the use of these sophisticated tools.&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/2.4.x/IDE&amp;lt;/ref&amp;gt;&lt;br /&gt;
Play framework supports a host of famous IDE's like:&lt;br /&gt;
*Eclipse&lt;br /&gt;
A simple command &amp;lt;code&amp;gt;eclipsify&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;eclipse&amp;lt;/code&amp;gt; generates the required Eclipse configurations to convert the existing application to an Eclipse-ready one.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[my-first-play-app] $ eclipse&lt;br /&gt;
[my-first-play-app] $ eclipsify&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*IntelliJ&lt;br /&gt;
This IDE does not require a command prompt to setup the project configurations. It provides a direct Play2.x project selection while creating a new project. Only perquisite is that the Scala and Play 2 plugins are enabled in the IDE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors ,which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel.&lt;br /&gt;
&lt;br /&gt;
Below is the sample creation of code: &amp;lt;ref&amp;gt;http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above actor &amp;lt;code&amp;gt;MyActor&amp;lt;/code&amp;gt; can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file.  &lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
&lt;br /&gt;
The following is a summary of the pros and cons of the 2 Play versions:&amp;lt;ref&amp;gt;http://stackoverflow.com/questions/8189893/what-are-the-major-differences-between-play-framework-1-0-and-2-0&amp;lt;/ref&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Involves Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Inversion of Control&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87726</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87726"/>
		<updated>2014-09-20T02:58:45Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* Backward compatibility */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt; It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&amp;lt;ref&amp;gt;http://www.reactivemanifesto.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
&lt;br /&gt;
==Motivation==&lt;br /&gt;
*To create a stateless web framework&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*To have an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*To provide full-stack web framework&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with Ebean by default with the option to use any other persistence mechanism. JUnit, Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*To provide a developer friendly feature driven framework&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework#Motivation&amp;lt;/ref&amp;gt;&lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to JSON and integration of compilers for CoffeeScript, LESS etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, RESTful by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play makes use of Akka which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. Netty supports non - blocking I/O and hence it is not expensive to make such calls.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt; The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History=== &lt;br /&gt;
&lt;br /&gt;
Below is the changes introduced in the releases: &amp;lt;ref&amp;gt;https://www.playframework.com/changelog&amp;lt;/ref&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/1.0/main&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. The model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory is the directory that imparts the feature of configuration-over-convention to the framework. It contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
Play.application().configuration().getInt(&amp;quot;number&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Compilation Errors===&lt;br /&gt;
The Play framework provides a hot deployment functionality. It means that code need not be compiled before deployment on the server. The developer can write the piece of code and directly hit refresh to execute the code. The compilation and execution happens at the time of deployment. Compilation errors, if any, are directly shown on the browser screen.&lt;br /&gt;
&lt;br /&gt;
Since, compilation and packaging happen at the time of deployment, Play does not have an elaborate development cycle. Although, two distinctive server modes are supported by Play. The '''DEV''' mode to be used for development purposes and the '''PROD''' mode when application is deployed. The main difference between the two modes is that hot reloading is not supported in the production mode.&lt;br /&gt;
&lt;br /&gt;
===IDE Support===&lt;br /&gt;
Since Play supports hot reloading, code can be typed on the fly and output can be received on the browser screen. Since there is no specific compilation phase involved, coding on Play framework does not require a [Integrated Development Environment (IDE) http://en.wikipedia.org/wiki/Integrated_development_environment]&lt;br /&gt;
Although code writing would not require the maximum usage of the IDE, activities like debugging and assisted refractoring in Java and Scala require the use of these sophisticated tools.&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/2.4.x/IDE&amp;lt;/ref&amp;gt;&lt;br /&gt;
Play framework supports a host of famous IDE's like:&lt;br /&gt;
*Eclipse&lt;br /&gt;
A simple command &amp;lt;code&amp;gt;eclipsify&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;eclipse&amp;lt;/code&amp;gt; generates the required Eclipse configurations to convert the existing application to an Eclipse-ready one.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[my-first-play-app] $ eclipse&lt;br /&gt;
[my-first-play-app] $ eclipsify&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*IntelliJ&lt;br /&gt;
This IDE does not require a command prompt to setup the project configurations. It provides a direct Play2.x project selection while creating a new project. Only perquisite is that the Scala and Play 2 plugins are enabled in the IDE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors ,which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel.&lt;br /&gt;
&lt;br /&gt;
Below is the sample creation of code: &amp;lt;ref&amp;gt;http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above actor &amp;lt;code&amp;gt;MyActor&amp;lt;/code&amp;gt; can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file.  &lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
The following is a summary of the pros and cons of the 2 Play versions:&amp;lt;ref&amp;gt;http://stackoverflow.com/questions/8189893/what-are-the-major-differences-between-play-framework-1-0-and-2-0&amp;lt;/ref&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Involves Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Inversion of Control&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87725</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87725"/>
		<updated>2014-09-20T02:58:28Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* Backward compatibility */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt; It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&amp;lt;ref&amp;gt;http://www.reactivemanifesto.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
&lt;br /&gt;
==Motivation==&lt;br /&gt;
*To create a stateless web framework&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*To have an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*To provide full-stack web framework&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with Ebean by default with the option to use any other persistence mechanism. JUnit, Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*To provide a developer friendly feature driven framework&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework#Motivation&amp;lt;/ref&amp;gt;&lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to JSON and integration of compilers for CoffeeScript, LESS etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, RESTful by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play makes use of Akka which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. Netty supports non - blocking I/O and hence it is not expensive to make such calls.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt; The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History=== &lt;br /&gt;
&lt;br /&gt;
Below is the changes introduced in the releases: &amp;lt;ref&amp;gt;https://www.playframework.com/changelog&amp;lt;/ref&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/1.0/main&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. The model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory is the directory that imparts the feature of configuration-over-convention to the framework. It contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
Play.application().configuration().getInt(&amp;quot;number&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Compilation Errors===&lt;br /&gt;
The Play framework provides a hot deployment functionality. It means that code need not be compiled before deployment on the server. The developer can write the piece of code and directly hit refresh to execute the code. The compilation and execution happens at the time of deployment. Compilation errors, if any, are directly shown on the browser screen.&lt;br /&gt;
&lt;br /&gt;
Since, compilation and packaging happen at the time of deployment, Play does not have an elaborate development cycle. Although, two distinctive server modes are supported by Play. The '''DEV''' mode to be used for development purposes and the '''PROD''' mode when application is deployed. The main difference between the two modes is that hot reloading is not supported in the production mode.&lt;br /&gt;
&lt;br /&gt;
===IDE Support===&lt;br /&gt;
Since Play supports hot reloading, code can be typed on the fly and output can be received on the browser screen. Since there is no specific compilation phase involved, coding on Play framework does not require a [Integrated Development Environment (IDE) http://en.wikipedia.org/wiki/Integrated_development_environment]&lt;br /&gt;
Although code writing would not require the maximum usage of the IDE, activities like debugging and assisted refractoring in Java and Scala require the use of these sophisticated tools.&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/2.4.x/IDE&amp;lt;/ref&amp;gt;&lt;br /&gt;
Play framework supports a host of famous IDE's like:&lt;br /&gt;
*Eclipse&lt;br /&gt;
A simple command &amp;lt;code&amp;gt;eclipsify&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;eclipse&amp;lt;/code&amp;gt; generates the required Eclipse configurations to convert the existing application to an Eclipse-ready one.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[my-first-play-app] $ eclipse&lt;br /&gt;
[my-first-play-app] $ eclipsify&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*IntelliJ&lt;br /&gt;
This IDE does not require a command prompt to setup the project configurations. It provides a direct Play2.x project selection while creating a new project. Only perquisite is that the Scala and Play 2 plugins are enabled in the IDE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors ,which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel.&lt;br /&gt;
&lt;br /&gt;
Below is the sample creation of code: &amp;lt;ref&amp;gt;http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above actor &amp;lt;code&amp;gt;MyActor&amp;lt;/code&amp;gt; can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file.  &lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. The following is a summary of the pros and cons of the 2 Play versions:&amp;lt;ref&amp;gt;http://stackoverflow.com/questions/8189893/what-are-the-major-differences-between-play-framework-1-0-and-2-0&amp;lt;/ref&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Involves Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Inversion of Control&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87723</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87723"/>
		<updated>2014-09-20T02:57:59Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* Backward compatibility */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt; It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&amp;lt;ref&amp;gt;http://www.reactivemanifesto.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
&lt;br /&gt;
==Motivation==&lt;br /&gt;
*To create a stateless web framework&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*To have an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*To provide full-stack web framework&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with Ebean by default with the option to use any other persistence mechanism. JUnit, Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*To provide a developer friendly feature driven framework&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework#Motivation&amp;lt;/ref&amp;gt;&lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to JSON and integration of compilers for CoffeeScript, LESS etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, RESTful by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play makes use of Akka which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. Netty supports non - blocking I/O and hence it is not expensive to make such calls.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt; The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History=== &lt;br /&gt;
&lt;br /&gt;
Below is the changes introduced in the releases: &amp;lt;ref&amp;gt;https://www.playframework.com/changelog&amp;lt;/ref&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/1.0/main&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. The model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory is the directory that imparts the feature of configuration-over-convention to the framework. It contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
Play.application().configuration().getInt(&amp;quot;number&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Compilation Errors===&lt;br /&gt;
The Play framework provides a hot deployment functionality. It means that code need not be compiled before deployment on the server. The developer can write the piece of code and directly hit refresh to execute the code. The compilation and execution happens at the time of deployment. Compilation errors, if any, are directly shown on the browser screen.&lt;br /&gt;
&lt;br /&gt;
Since, compilation and packaging happen at the time of deployment, Play does not have an elaborate development cycle. Although, two distinctive server modes are supported by Play. The '''DEV''' mode to be used for development purposes and the '''PROD''' mode when application is deployed. The main difference between the two modes is that hot reloading is not supported in the production mode.&lt;br /&gt;
&lt;br /&gt;
===IDE Support===&lt;br /&gt;
Since Play supports hot reloading, code can be typed on the fly and output can be received on the browser screen. Since there is no specific compilation phase involved, coding on Play framework does not require a [Integrated Development Environment (IDE) http://en.wikipedia.org/wiki/Integrated_development_environment]&lt;br /&gt;
Although code writing would not require the maximum usage of the IDE, activities like debugging and assisted refractoring in Java and Scala require the use of these sophisticated tools.&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/2.4.x/IDE&amp;lt;/ref&amp;gt;&lt;br /&gt;
Play framework supports a host of famous IDE's like:&lt;br /&gt;
*Eclipse&lt;br /&gt;
A simple command &amp;lt;code&amp;gt;eclipsify&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;eclipse&amp;lt;/code&amp;gt; generates the required Eclipse configurations to convert the existing application to an Eclipse-ready one.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[my-first-play-app] $ eclipse&lt;br /&gt;
[my-first-play-app] $ eclipsify&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*IntelliJ&lt;br /&gt;
This IDE does not require a command prompt to setup the project configurations. It provides a direct Play2.x project selection while creating a new project. Only perquisite is that the Scala and Play 2 plugins are enabled in the IDE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors ,which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel.&lt;br /&gt;
&lt;br /&gt;
Below is the sample creation of code: &amp;lt;ref&amp;gt;http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above actor &amp;lt;code&amp;gt;MyActor&amp;lt;/code&amp;gt; can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file.  &lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
&lt;br /&gt;
The following is a summary of the pros and cons of the 2 Play versions:&amp;lt;ref&amp;gt;http://stackoverflow.com/questions/8189893/what-are-the-major-differences-between-play-framework-1-0-and-2-0&amp;lt;/ref&amp;gt; &lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Involves Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Inversion of Control&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87720</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87720"/>
		<updated>2014-09-20T02:57:42Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* Backward compatibility */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt; It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&amp;lt;ref&amp;gt;http://www.reactivemanifesto.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
&lt;br /&gt;
==Motivation==&lt;br /&gt;
*To create a stateless web framework&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*To have an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*To provide full-stack web framework&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with Ebean by default with the option to use any other persistence mechanism. JUnit, Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*To provide a developer friendly feature driven framework&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework#Motivation&amp;lt;/ref&amp;gt;&lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to JSON and integration of compilers for CoffeeScript, LESS etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, RESTful by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play makes use of Akka which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. Netty supports non - blocking I/O and hence it is not expensive to make such calls.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt; The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History=== &lt;br /&gt;
&lt;br /&gt;
Below is the changes introduced in the releases: &amp;lt;ref&amp;gt;https://www.playframework.com/changelog&amp;lt;/ref&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/1.0/main&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. The model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory is the directory that imparts the feature of configuration-over-convention to the framework. It contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
Play.application().configuration().getInt(&amp;quot;number&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Compilation Errors===&lt;br /&gt;
The Play framework provides a hot deployment functionality. It means that code need not be compiled before deployment on the server. The developer can write the piece of code and directly hit refresh to execute the code. The compilation and execution happens at the time of deployment. Compilation errors, if any, are directly shown on the browser screen.&lt;br /&gt;
&lt;br /&gt;
Since, compilation and packaging happen at the time of deployment, Play does not have an elaborate development cycle. Although, two distinctive server modes are supported by Play. The '''DEV''' mode to be used for development purposes and the '''PROD''' mode when application is deployed. The main difference between the two modes is that hot reloading is not supported in the production mode.&lt;br /&gt;
&lt;br /&gt;
===IDE Support===&lt;br /&gt;
Since Play supports hot reloading, code can be typed on the fly and output can be received on the browser screen. Since there is no specific compilation phase involved, coding on Play framework does not require a [Integrated Development Environment (IDE) http://en.wikipedia.org/wiki/Integrated_development_environment]&lt;br /&gt;
Although code writing would not require the maximum usage of the IDE, activities like debugging and assisted refractoring in Java and Scala require the use of these sophisticated tools.&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/2.4.x/IDE&amp;lt;/ref&amp;gt;&lt;br /&gt;
Play framework supports a host of famous IDE's like:&lt;br /&gt;
*Eclipse&lt;br /&gt;
A simple command &amp;lt;code&amp;gt;eclipsify&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;eclipse&amp;lt;/code&amp;gt; generates the required Eclipse configurations to convert the existing application to an Eclipse-ready one.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[my-first-play-app] $ eclipse&lt;br /&gt;
[my-first-play-app] $ eclipsify&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*IntelliJ&lt;br /&gt;
This IDE does not require a command prompt to setup the project configurations. It provides a direct Play2.x project selection while creating a new project. Only perquisite is that the Scala and Play 2 plugins are enabled in the IDE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors ,which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel.&lt;br /&gt;
&lt;br /&gt;
Below is the sample creation of code: &amp;lt;ref&amp;gt;http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above actor &amp;lt;code&amp;gt;MyActor&amp;lt;/code&amp;gt; can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file.  &lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
The following is a summary of the pros and cons of the 2 Play versions:&amp;lt;ref&amp;gt;http://stackoverflow.com/questions/8189893/what-are-the-major-differences-between-play-framework-1-0-and-2-0&amp;lt;/ref&amp;gt; &lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Involves Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Inversion of Control&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87718</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87718"/>
		<updated>2014-09-20T02:57:14Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* Backward compatibility */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt; It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&amp;lt;ref&amp;gt;http://www.reactivemanifesto.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
&lt;br /&gt;
==Motivation==&lt;br /&gt;
*To create a stateless web framework&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*To have an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*To provide full-stack web framework&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with Ebean by default with the option to use any other persistence mechanism. JUnit, Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*To provide a developer friendly feature driven framework&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework#Motivation&amp;lt;/ref&amp;gt;&lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to JSON and integration of compilers for CoffeeScript, LESS etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, RESTful by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play makes use of Akka which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. Netty supports non - blocking I/O and hence it is not expensive to make such calls.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt; The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History=== &lt;br /&gt;
&lt;br /&gt;
Below is the changes introduced in the releases: &amp;lt;ref&amp;gt;https://www.playframework.com/changelog&amp;lt;/ref&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/1.0/main&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. The model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory is the directory that imparts the feature of configuration-over-convention to the framework. It contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
Play.application().configuration().getInt(&amp;quot;number&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Compilation Errors===&lt;br /&gt;
The Play framework provides a hot deployment functionality. It means that code need not be compiled before deployment on the server. The developer can write the piece of code and directly hit refresh to execute the code. The compilation and execution happens at the time of deployment. Compilation errors, if any, are directly shown on the browser screen.&lt;br /&gt;
&lt;br /&gt;
Since, compilation and packaging happen at the time of deployment, Play does not have an elaborate development cycle. Although, two distinctive server modes are supported by Play. The '''DEV''' mode to be used for development purposes and the '''PROD''' mode when application is deployed. The main difference between the two modes is that hot reloading is not supported in the production mode.&lt;br /&gt;
&lt;br /&gt;
===IDE Support===&lt;br /&gt;
Since Play supports hot reloading, code can be typed on the fly and output can be received on the browser screen. Since there is no specific compilation phase involved, coding on Play framework does not require a [Integrated Development Environment (IDE) http://en.wikipedia.org/wiki/Integrated_development_environment]&lt;br /&gt;
Although code writing would not require the maximum usage of the IDE, activities like debugging and assisted refractoring in Java and Scala require the use of these sophisticated tools.&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/2.4.x/IDE&amp;lt;/ref&amp;gt;&lt;br /&gt;
Play framework supports a host of famous IDE's like:&lt;br /&gt;
*Eclipse&lt;br /&gt;
A simple command &amp;lt;code&amp;gt;eclipsify&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;eclipse&amp;lt;/code&amp;gt; generates the required Eclipse configurations to convert the existing application to an Eclipse-ready one.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[my-first-play-app] $ eclipse&lt;br /&gt;
[my-first-play-app] $ eclipsify&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*IntelliJ&lt;br /&gt;
This IDE does not require a command prompt to setup the project configurations. It provides a direct Play2.x project selection while creating a new project. Only perquisite is that the Scala and Play 2 plugins are enabled in the IDE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors ,which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel.&lt;br /&gt;
&lt;br /&gt;
Below is the sample creation of code: &amp;lt;ref&amp;gt;http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above actor &amp;lt;code&amp;gt;MyActor&amp;lt;/code&amp;gt; can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file.  &lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
The following is a summary of the pros and cons of the 2 Play versions:&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;ref&amp;gt;http://stackoverflow.com/questions/8189893/what-are-the-major-differences-between-play-framework-1-0-and-2-0&amp;lt;/ref&amp;gt; &lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Involves Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Inversion of Control&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87715</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87715"/>
		<updated>2014-09-20T02:55:55Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* Motivation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt; It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&amp;lt;ref&amp;gt;http://www.reactivemanifesto.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
&lt;br /&gt;
==Motivation==&lt;br /&gt;
*To create a stateless web framework&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*To have an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*To provide full-stack web framework&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with Ebean by default with the option to use any other persistence mechanism. JUnit, Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*To provide a developer friendly feature driven framework&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework#Motivation&amp;lt;/ref&amp;gt;&lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to JSON and integration of compilers for CoffeeScript, LESS etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, RESTful by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play makes use of Akka which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. Netty supports non - blocking I/O and hence it is not expensive to make such calls.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt; The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History=== &lt;br /&gt;
&lt;br /&gt;
Below is the changes introduced in the releases: &amp;lt;ref&amp;gt;https://www.playframework.com/changelog&amp;lt;/ref&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/1.0/main&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. The model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory is the directory that imparts the feature of configuration-over-convention to the framework. It contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
Play.application().configuration().getInt(&amp;quot;number&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Compilation Errors===&lt;br /&gt;
The Play framework provides a hot deployment functionality. It means that code need not be compiled before deployment on the server. The developer can write the piece of code and directly hit refresh to execute the code. The compilation and execution happens at the time of deployment. Compilation errors, if any, are directly shown on the browser screen.&lt;br /&gt;
&lt;br /&gt;
Since, compilation and packaging happen at the time of deployment, Play does not have an elaborate development cycle. Although, two distinctive server modes are supported by Play. The '''DEV''' mode to be used for development purposes and the '''PROD''' mode when application is deployed. The main difference between the two modes is that hot reloading is not supported in the production mode.&lt;br /&gt;
&lt;br /&gt;
===IDE Support===&lt;br /&gt;
Since Play supports hot reloading, code can be typed on the fly and output can be received on the browser screen. Since there is no specific compilation phase involved, coding on Play framework does not require a [Integrated Development Environment (IDE) http://en.wikipedia.org/wiki/Integrated_development_environment]&lt;br /&gt;
Although code writing would not require the maximum usage of the IDE, activities like debugging and assisted refractoring in Java and Scala require the use of these sophisticated tools.&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/2.4.x/IDE&amp;lt;/ref&amp;gt;&lt;br /&gt;
Play framework supports a host of famous IDE's like:&lt;br /&gt;
*Eclipse&lt;br /&gt;
A simple command &amp;lt;code&amp;gt;eclipsify&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;eclipse&amp;lt;/code&amp;gt; generates the required Eclipse configurations to convert the existing application to an Eclipse-ready one.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[my-first-play-app] $ eclipse&lt;br /&gt;
[my-first-play-app] $ eclipsify&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*IntelliJ&lt;br /&gt;
This IDE does not require a command prompt to setup the project configurations. It provides a direct Play2.x project selection while creating a new project. Only perquisite is that the Scala and Play 2 plugins are enabled in the IDE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors ,which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel.&lt;br /&gt;
&lt;br /&gt;
Below is the sample creation of code: &amp;lt;ref&amp;gt;http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above actor &amp;lt;code&amp;gt;MyActor&amp;lt;/code&amp;gt; can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file.  &lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
The following is a summary of the pros and cons of the 2 Play versions:&amp;lt;ref&amp;gt;http://stackoverflow.com/questions/8189893/what-are-the-major-differences-between-play-framework-1-0-and-2-0&amp;lt;/ref&amp;gt; &lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Involves Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Inversion of Control&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87710</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87710"/>
		<updated>2014-09-20T02:54:14Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* Motivation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt; It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&amp;lt;ref&amp;gt;http://www.reactivemanifesto.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
&lt;br /&gt;
==Motivation==&lt;br /&gt;
*To create a stateless web framework&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*To have an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture&amp;lt;ref&amp;gt;http://www.slideshare.net/PhilipLanger/playframework-34001972&amp;lt;/ref&amp;gt;&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*To provide full-stack web framework&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with Ebean by default with the option to use any other persistence mechanism. JUnit, Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*To provide a developer friendly feature driven framework&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework#Motivation&amp;lt;/ref&amp;gt;&lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to JSON and integration of compilers for CoffeeScript, LESS etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, RESTful by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play makes use of Akka which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. Netty supports non - blocking I/O and hence it is not expensive to make such calls.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt; The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History=== &lt;br /&gt;
&lt;br /&gt;
Below is the changes introduced in the releases: &amp;lt;ref&amp;gt;https://www.playframework.com/changelog&amp;lt;/ref&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/1.0/main&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. The model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory is the directory that imparts the feature of configuration-over-convention to the framework. It contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
Play.application().configuration().getInt(&amp;quot;number&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Compilation Errors===&lt;br /&gt;
The Play framework provides a hot deployment functionality. It means that code need not be compiled before deployment on the server. The developer can write the piece of code and directly hit refresh to execute the code. The compilation and execution happens at the time of deployment. Compilation errors, if any, are directly shown on the browser screen.&lt;br /&gt;
&lt;br /&gt;
Since, compilation and packaging happen at the time of deployment, Play does not have an elaborate development cycle. Although, two distinctive server modes are supported by Play. The '''DEV''' mode to be used for development purposes and the '''PROD''' mode when application is deployed. The main difference between the two modes is that hot reloading is not supported in the production mode.&lt;br /&gt;
&lt;br /&gt;
===IDE Support===&lt;br /&gt;
Since Play supports hot reloading, code can be typed on the fly and output can be received on the browser screen. Since there is no specific compilation phase involved, coding on Play framework does not require a [Integrated Development Environment (IDE) http://en.wikipedia.org/wiki/Integrated_development_environment]&lt;br /&gt;
Although code writing would not require the maximum usage of the IDE, activities like debugging and assisted refractoring in Java and Scala require the use of these sophisticated tools.&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/2.4.x/IDE&amp;lt;/ref&amp;gt;&lt;br /&gt;
Play framework supports a host of famous IDE's like:&lt;br /&gt;
*Eclipse&lt;br /&gt;
A simple command &amp;lt;code&amp;gt;eclipsify&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;eclipse&amp;lt;/code&amp;gt; generates the required Eclipse configurations to convert the existing application to an Eclipse-ready one.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[my-first-play-app] $ eclipse&lt;br /&gt;
[my-first-play-app] $ eclipsify&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*IntelliJ&lt;br /&gt;
This IDE does not require a command prompt to setup the project configurations. It provides a direct Play2.x project selection while creating a new project. Only perquisite is that the Scala and Play 2 plugins are enabled in the IDE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors ,which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel.&lt;br /&gt;
&lt;br /&gt;
Below is the sample creation of code: &amp;lt;ref&amp;gt;http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above actor &amp;lt;code&amp;gt;MyActor&amp;lt;/code&amp;gt; can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file.  &lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
The following is a summary of the pros and cons of the 2 Play versions:&amp;lt;ref&amp;gt;http://stackoverflow.com/questions/8189893/what-are-the-major-differences-between-play-framework-1-0-and-2-0&amp;lt;/ref&amp;gt; &lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Involves Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Inversion of Control&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87706</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87706"/>
		<updated>2014-09-20T02:52:57Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* Motivation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt; It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&amp;lt;ref&amp;gt;http://www.reactivemanifesto.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
&lt;br /&gt;
==Motivation==&lt;br /&gt;
*To create a stateless web framework&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*To have an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*To provide full-stack web framework&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with Ebean by default with the option to use any other persistence mechanism. JUnit, Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*To provide a developer friendly feature driven framework&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework#Motivation&amp;lt;/ref&amp;gt;&lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to JSON and integration of compilers for CoffeeScript, LESS etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, RESTful by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play makes use of Akka which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. Netty supports non - blocking I/O and hence it is not expensive to make such calls.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt; The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History=== &lt;br /&gt;
&lt;br /&gt;
Below is the changes introduced in the releases: &amp;lt;ref&amp;gt;https://www.playframework.com/changelog&amp;lt;/ref&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/1.0/main&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. The model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory is the directory that imparts the feature of configuration-over-convention to the framework. It contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
Play.application().configuration().getInt(&amp;quot;number&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Compilation Errors===&lt;br /&gt;
The Play framework provides a hot deployment functionality. It means that code need not be compiled before deployment on the server. The developer can write the piece of code and directly hit refresh to execute the code. The compilation and execution happens at the time of deployment. Compilation errors, if any, are directly shown on the browser screen.&lt;br /&gt;
&lt;br /&gt;
Since, compilation and packaging happen at the time of deployment, Play does not have an elaborate development cycle. Although, two distinctive server modes are supported by Play. The '''DEV''' mode to be used for development purposes and the '''PROD''' mode when application is deployed. The main difference between the two modes is that hot reloading is not supported in the production mode.&lt;br /&gt;
&lt;br /&gt;
===IDE Support===&lt;br /&gt;
Since Play supports hot reloading, code can be typed on the fly and output can be received on the browser screen. Since there is no specific compilation phase involved, coding on Play framework does not require a [Integrated Development Environment (IDE) http://en.wikipedia.org/wiki/Integrated_development_environment]&lt;br /&gt;
Although code writing would not require the maximum usage of the IDE, activities like debugging and assisted refractoring in Java and Scala require the use of these sophisticated tools.&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/2.4.x/IDE&amp;lt;/ref&amp;gt;&lt;br /&gt;
Play framework supports a host of famous IDE's like:&lt;br /&gt;
*Eclipse&lt;br /&gt;
A simple command &amp;lt;code&amp;gt;eclipsify&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;eclipse&amp;lt;/code&amp;gt; generates the required Eclipse configurations to convert the existing application to an Eclipse-ready one.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[my-first-play-app] $ eclipse&lt;br /&gt;
[my-first-play-app] $ eclipsify&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*IntelliJ&lt;br /&gt;
This IDE does not require a command prompt to setup the project configurations. It provides a direct Play2.x project selection while creating a new project. Only perquisite is that the Scala and Play 2 plugins are enabled in the IDE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors ,which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel.&lt;br /&gt;
&lt;br /&gt;
Below is the sample creation of code: &amp;lt;ref&amp;gt;http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above actor &amp;lt;code&amp;gt;MyActor&amp;lt;/code&amp;gt; can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file.  &lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
The following is a summary of the pros and cons of the 2 Play versions:&amp;lt;ref&amp;gt;http://stackoverflow.com/questions/8189893/what-are-the-major-differences-between-play-framework-1-0-and-2-0&amp;lt;/ref&amp;gt; &lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Involves Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Inversion of Control&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87704</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87704"/>
		<updated>2014-09-20T02:52:16Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* Motivation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt; It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&amp;lt;ref&amp;gt;http://www.reactivemanifesto.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
&lt;br /&gt;
==Motivation==&lt;br /&gt;
*To create a stateless web framework&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*To have an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*To provide full-stack web framework&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with Ebean by default with the option to use any other persistence mechanism. JUnit, Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*To provide a developer friendly feature driven framework&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt;&lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to JSON and integration of compilers for CoffeeScript, LESS etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, RESTful by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play makes use of Akka which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. Netty supports non - blocking I/O and hence it is not expensive to make such calls.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt; The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History=== &lt;br /&gt;
&lt;br /&gt;
Below is the changes introduced in the releases: &amp;lt;ref&amp;gt;https://www.playframework.com/changelog&amp;lt;/ref&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/1.0/main&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. The model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory is the directory that imparts the feature of configuration-over-convention to the framework. It contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
Play.application().configuration().getInt(&amp;quot;number&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Compilation Errors===&lt;br /&gt;
The Play framework provides a hot deployment functionality. It means that code need not be compiled before deployment on the server. The developer can write the piece of code and directly hit refresh to execute the code. The compilation and execution happens at the time of deployment. Compilation errors, if any, are directly shown on the browser screen.&lt;br /&gt;
&lt;br /&gt;
Since, compilation and packaging happen at the time of deployment, Play does not have an elaborate development cycle. Although, two distinctive server modes are supported by Play. The '''DEV''' mode to be used for development purposes and the '''PROD''' mode when application is deployed. The main difference between the two modes is that hot reloading is not supported in the production mode.&lt;br /&gt;
&lt;br /&gt;
===IDE Support===&lt;br /&gt;
Since Play supports hot reloading, code can be typed on the fly and output can be received on the browser screen. Since there is no specific compilation phase involved, coding on Play framework does not require a [Integrated Development Environment (IDE) http://en.wikipedia.org/wiki/Integrated_development_environment]&lt;br /&gt;
Although code writing would not require the maximum usage of the IDE, activities like debugging and assisted refractoring in Java and Scala require the use of these sophisticated tools.&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/2.4.x/IDE&amp;lt;/ref&amp;gt;&lt;br /&gt;
Play framework supports a host of famous IDE's like:&lt;br /&gt;
*Eclipse&lt;br /&gt;
A simple command &amp;lt;code&amp;gt;eclipsify&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;eclipse&amp;lt;/code&amp;gt; generates the required Eclipse configurations to convert the existing application to an Eclipse-ready one.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[my-first-play-app] $ eclipse&lt;br /&gt;
[my-first-play-app] $ eclipsify&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*IntelliJ&lt;br /&gt;
This IDE does not require a command prompt to setup the project configurations. It provides a direct Play2.x project selection while creating a new project. Only perquisite is that the Scala and Play 2 plugins are enabled in the IDE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors ,which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel.&lt;br /&gt;
&lt;br /&gt;
Below is the sample creation of code: &amp;lt;ref&amp;gt;http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above actor &amp;lt;code&amp;gt;MyActor&amp;lt;/code&amp;gt; can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file.  &lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
The following is a summary of the pros and cons of the 2 Play versions:&amp;lt;ref&amp;gt;http://stackoverflow.com/questions/8189893/what-are-the-major-differences-between-play-framework-1-0-and-2-0&amp;lt;/ref&amp;gt; &lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Involves Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Inversion of Control&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87702</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87702"/>
		<updated>2014-09-20T02:51:23Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* Features of Play Framework */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt; It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&amp;lt;ref&amp;gt;http://www.reactivemanifesto.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
&lt;br /&gt;
==Motivation==&lt;br /&gt;
*To create a stateless web framework&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*To have an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*To provide full-stack web framework&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with Ebean by default with the option to use any other persistence mechanism. JUnit, Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*To provide a developer friendly feature driven framework &lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to JSON and integration of compilers for CoffeeScript, LESS etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, RESTful by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play makes use of Akka which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. Netty supports non - blocking I/O and hence it is not expensive to make such calls.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt; The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History=== &lt;br /&gt;
&lt;br /&gt;
Below is the changes introduced in the releases: &amp;lt;ref&amp;gt;https://www.playframework.com/changelog&amp;lt;/ref&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/1.0/main&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. The model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory is the directory that imparts the feature of configuration-over-convention to the framework. It contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
Play.application().configuration().getInt(&amp;quot;number&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Compilation Errors===&lt;br /&gt;
The Play framework provides a hot deployment functionality. It means that code need not be compiled before deployment on the server. The developer can write the piece of code and directly hit refresh to execute the code. The compilation and execution happens at the time of deployment. Compilation errors, if any, are directly shown on the browser screen.&lt;br /&gt;
&lt;br /&gt;
Since, compilation and packaging happen at the time of deployment, Play does not have an elaborate development cycle. Although, two distinctive server modes are supported by Play. The '''DEV''' mode to be used for development purposes and the '''PROD''' mode when application is deployed. The main difference between the two modes is that hot reloading is not supported in the production mode.&lt;br /&gt;
&lt;br /&gt;
===IDE Support===&lt;br /&gt;
Since Play supports hot reloading, code can be typed on the fly and output can be received on the browser screen. Since there is no specific compilation phase involved, coding on Play framework does not require a [Integrated Development Environment (IDE) http://en.wikipedia.org/wiki/Integrated_development_environment]&lt;br /&gt;
Although code writing would not require the maximum usage of the IDE, activities like debugging and assisted refractoring in Java and Scala require the use of these sophisticated tools.&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/2.4.x/IDE&amp;lt;/ref&amp;gt;&lt;br /&gt;
Play framework supports a host of famous IDE's like:&lt;br /&gt;
*Eclipse&lt;br /&gt;
A simple command &amp;lt;code&amp;gt;eclipsify&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;eclipse&amp;lt;/code&amp;gt; generates the required Eclipse configurations to convert the existing application to an Eclipse-ready one.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[my-first-play-app] $ eclipse&lt;br /&gt;
[my-first-play-app] $ eclipsify&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*IntelliJ&lt;br /&gt;
This IDE does not require a command prompt to setup the project configurations. It provides a direct Play2.x project selection while creating a new project. Only perquisite is that the Scala and Play 2 plugins are enabled in the IDE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors ,which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel.&lt;br /&gt;
&lt;br /&gt;
Below is the sample creation of code: &amp;lt;ref&amp;gt;http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above actor &amp;lt;code&amp;gt;MyActor&amp;lt;/code&amp;gt; can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file.  &lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
The following is a summary of the pros and cons of the 2 Play versions:&amp;lt;ref&amp;gt;http://stackoverflow.com/questions/8189893/what-are-the-major-differences-between-play-framework-1-0-and-2-0&amp;lt;/ref&amp;gt; &lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Involves Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Inversion of Control&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87687</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87687"/>
		<updated>2014-09-20T02:47:36Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* Features of Play Framework */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt; It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&amp;lt;ref&amp;gt;http://www.reactivemanifesto.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
&lt;br /&gt;
==Motivation==&lt;br /&gt;
*To create a stateless web framework&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*To have an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*To provide full-stack web framework&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with Ebean by default with the option to use any other persistence mechanism. JUnit, Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*To provide a developer friendly feature driven framework &lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to JSON and integration of compilers for CoffeeScript, LESS etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, RESTful by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play makes use of Akka which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. Netty supports non - blocking I/O and hence it is not expensive to make such calls.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt; The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History=== &lt;br /&gt;
&lt;br /&gt;
Below is the changes introduced in the releases: &amp;lt;ref&amp;gt;https://www.playframework.com/changelog&amp;lt;/ref&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/1.0/main&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. The model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory is the directory that imparts the feature of configuration-over-convention to the framework. It contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
Play.application().configuration().getInt(&amp;quot;number&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Compilation Errors===&lt;br /&gt;
The Play framework provides a hot deployment functionality. It means that code need not be compiled before deployment on the server. The developer can write the piece of code and directly hit refresh to execute the code. The compilation and execution happens at the time of deployment. Compilation errors, if any, are directly shown on the browser screen.&lt;br /&gt;
&lt;br /&gt;
Since, compilation and packaging happen at the time of deployment, Play does not have an elaborate development cycle. Although, two distinctive server modes are supported by Play. The '''DEV''' mode to be used for development purposes and the '''PROD''' mode when application is deployed. The main difference between the two modes is that hot reloading is not supported in the production mode.&lt;br /&gt;
&lt;br /&gt;
===IDE Support===&lt;br /&gt;
Since Play supports hot reloading, code can be typed on the fly and output can be received on the browser screen. Since there is no specific compilation phase involved, coding on Play framework does not require a [Integrated Development Environment (IDE) http://en.wikipedia.org/wiki/Integrated_development_environment]&lt;br /&gt;
Although code writing would not require the maximum usage of the IDE, activities like debugging and assisted refractoring in Java and Scala require the use of these sophisticated tools.&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/2.4.x/IDE&amp;lt;/ref&amp;gt;&lt;br /&gt;
Play framework supports a host of famous IDE's like:&lt;br /&gt;
*Eclipse&lt;br /&gt;
A simple command &amp;lt;code&amp;gt;eclipsify&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;eclipse&amp;lt;/code&amp;gt; generates the required Eclipse configurations to convert the existing application to an Eclipse-ready one.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[my-first-play-app] $ eclipse&lt;br /&gt;
[my-first-play-app] $ eclipsify&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*IntelliJ&lt;br /&gt;
This IDE does not require a command prompt to setup the project configurations. It provides a direct Play2.x project selection while creating a new project. Only perquisite is that the Scala and Play 2 plugins are enabled in the IDE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors ,which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel.&lt;br /&gt;
&lt;br /&gt;
Below is the sample creation of code: &amp;lt;ref&amp;gt;http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above actor &amp;lt;code&amp;gt;MyActor&amp;lt;/code&amp;gt; can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file.  &lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
The following is a summary of the pros and cons of the 2 Play versions:&amp;lt;ref&amp;gt;http://stackoverflow.com/questions/8189893/what-are-the-major-differences-between-play-framework-1-0-and-2-0&amp;lt;/ref&amp;gt; &lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Involves Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Inversion of Control&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87681</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87681"/>
		<updated>2014-09-20T02:45:07Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* Features of Play Framework */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt; It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&amp;lt;ref&amp;gt;http://www.reactivemanifesto.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
&lt;br /&gt;
==Motivation==&lt;br /&gt;
*To create a stateless web framework&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*To have an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*To provide full-stack web framework&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with Ebean by default with the option to use any other persistence mechanism. JUnit, Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*To provide a developer friendly feature driven framework &lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to JSON and integration of compilers for CoffeeScript, LESS etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, RESTful by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play makes use of Akka which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. Netty supports non - blocking I/O and hence it is not expensive to make such calls.&amp;lt;ref&amp;gt;http://www.quora.com/What-are-the-pros-and-cons-of-the-Play-Framework-2-for-a-Java-developer&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt; The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History=== &lt;br /&gt;
&lt;br /&gt;
Below is the changes introduced in the releases: &amp;lt;ref&amp;gt;https://www.playframework.com/changelog&amp;lt;/ref&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/1.0/main&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. The model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory is the directory that imparts the feature of configuration-over-convention to the framework. It contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
Play.application().configuration().getInt(&amp;quot;number&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Compilation Errors===&lt;br /&gt;
The Play framework provides a hot deployment functionality. It means that code need not be compiled before deployment on the server. The developer can write the piece of code and directly hit refresh to execute the code. The compilation and execution happens at the time of deployment. Compilation errors, if any, are directly shown on the browser screen.&lt;br /&gt;
&lt;br /&gt;
Since, compilation and packaging happen at the time of deployment, Play does not have an elaborate development cycle. Although, two distinctive server modes are supported by Play. The '''DEV''' mode to be used for development purposes and the '''PROD''' mode when application is deployed. The main difference between the two modes is that hot reloading is not supported in the production mode.&lt;br /&gt;
&lt;br /&gt;
===IDE Support===&lt;br /&gt;
Since Play supports hot reloading, code can be typed on the fly and output can be received on the browser screen. Since there is no specific compilation phase involved, coding on Play framework does not require a [Integrated Development Environment (IDE) http://en.wikipedia.org/wiki/Integrated_development_environment]&lt;br /&gt;
Although code writing would not require the maximum usage of the IDE, activities like debugging and assisted refractoring in Java and Scala require the use of these sophisticated tools.&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/2.4.x/IDE&amp;lt;/ref&amp;gt;&lt;br /&gt;
Play framework supports a host of famous IDE's like:&lt;br /&gt;
*Eclipse&lt;br /&gt;
A simple command &amp;lt;code&amp;gt;eclipsify&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;eclipse&amp;lt;/code&amp;gt; generates the required Eclipse configurations to convert the existing application to an Eclipse-ready one.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[my-first-play-app] $ eclipse&lt;br /&gt;
[my-first-play-app] $ eclipsify&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*IntelliJ&lt;br /&gt;
This IDE does not require a command prompt to setup the project configurations. It provides a direct Play2.x project selection while creating a new project. Only perquisite is that the Scala and Play 2 plugins are enabled in the IDE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors ,which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel.&lt;br /&gt;
&lt;br /&gt;
Below is the sample creation of code: &amp;lt;ref&amp;gt;http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above actor &amp;lt;code&amp;gt;MyActor&amp;lt;/code&amp;gt; can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file.  &lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
The following is a summary of the pros and cons of the 2 Play versions:&amp;lt;ref&amp;gt;http://stackoverflow.com/questions/8189893/what-are-the-major-differences-between-play-framework-1-0-and-2-0&amp;lt;/ref&amp;gt; &lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Involves Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Inversion of Control&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87677</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87677"/>
		<updated>2014-09-20T02:44:25Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* Features of Play Framework */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt; It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&amp;lt;ref&amp;gt;http://www.reactivemanifesto.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
&lt;br /&gt;
==Motivation==&lt;br /&gt;
*To create a stateless web framework&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*To have an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*To provide full-stack web framework&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with Ebean by default with the option to use any other persistence mechanism. JUnit, Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*To provide a developer friendly feature driven framework &lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to JSON and integration of compilers for CoffeeScript, LESS etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, RESTful by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play makes use of Akka which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. Netty supports non - blocking I/O and hence it is not expensive to make such calls. &lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt; The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History=== &lt;br /&gt;
&lt;br /&gt;
Below is the changes introduced in the releases: &amp;lt;ref&amp;gt;https://www.playframework.com/changelog&amp;lt;/ref&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/1.0/main&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. The model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory is the directory that imparts the feature of configuration-over-convention to the framework. It contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
Play.application().configuration().getInt(&amp;quot;number&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Compilation Errors===&lt;br /&gt;
The Play framework provides a hot deployment functionality. It means that code need not be compiled before deployment on the server. The developer can write the piece of code and directly hit refresh to execute the code. The compilation and execution happens at the time of deployment. Compilation errors, if any, are directly shown on the browser screen.&lt;br /&gt;
&lt;br /&gt;
Since, compilation and packaging happen at the time of deployment, Play does not have an elaborate development cycle. Although, two distinctive server modes are supported by Play. The '''DEV''' mode to be used for development purposes and the '''PROD''' mode when application is deployed. The main difference between the two modes is that hot reloading is not supported in the production mode.&lt;br /&gt;
&lt;br /&gt;
===IDE Support===&lt;br /&gt;
Since Play supports hot reloading, code can be typed on the fly and output can be received on the browser screen. Since there is no specific compilation phase involved, coding on Play framework does not require a [Integrated Development Environment (IDE) http://en.wikipedia.org/wiki/Integrated_development_environment]&lt;br /&gt;
Although code writing would not require the maximum usage of the IDE, activities like debugging and assisted refractoring in Java and Scala require the use of these sophisticated tools.&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/2.4.x/IDE&amp;lt;/ref&amp;gt;&lt;br /&gt;
Play framework supports a host of famous IDE's like:&lt;br /&gt;
*Eclipse&lt;br /&gt;
A simple command &amp;lt;code&amp;gt;eclipsify&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;eclipse&amp;lt;/code&amp;gt; generates the required Eclipse configurations to convert the existing application to an Eclipse-ready one.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[my-first-play-app] $ eclipse&lt;br /&gt;
[my-first-play-app] $ eclipsify&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*IntelliJ&lt;br /&gt;
This IDE does not require a command prompt to setup the project configurations. It provides a direct Play2.x project selection while creating a new project. Only perquisite is that the Scala and Play 2 plugins are enabled in the IDE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors ,which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel.&lt;br /&gt;
&lt;br /&gt;
Below is the sample creation of code: &amp;lt;ref&amp;gt;http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above actor &amp;lt;code&amp;gt;MyActor&amp;lt;/code&amp;gt; can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file.  &lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
The following is a summary of the pros and cons of the 2 Play versions:&amp;lt;ref&amp;gt;http://stackoverflow.com/questions/8189893/what-are-the-major-differences-between-play-framework-1-0-and-2-0&amp;lt;/ref&amp;gt; &lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Involves Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Inversion of Control&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87665</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=87665"/>
		<updated>2014-09-20T02:42:05Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* Features of Play Framework */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala.&amp;lt;ref&amp;gt;https://www.playframework.com/&amp;lt;/ref&amp;gt; It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&amp;lt;ref&amp;gt;http://www.reactivemanifesto.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
&lt;br /&gt;
==Motivation==&lt;br /&gt;
*To create a stateless web framework&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*To have an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*To provide full-stack web framework&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with Ebean by default with the option to use any other persistence mechanism. JUnit, Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*To provide a developer friendly feature driven framework &lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to JSON and integration of compilers for CoffeeScript, LESS etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, RESTful by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Play makes use of Akka which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up. &lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. Netty supports non - blocking I/O and hence it is not expensive to make such calls. &lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Play_framework&amp;lt;/ref&amp;gt; The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History=== &lt;br /&gt;
&lt;br /&gt;
Below is the changes introduced in the releases: &amp;lt;ref&amp;gt;https://www.playframework.com/changelog&amp;lt;/ref&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/1.0/main&amp;lt;/ref&amp;gt;&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. The model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory is the directory that imparts the feature of configuration-over-convention to the framework. It contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
Play.application().configuration().getInt(&amp;quot;number&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Compilation Errors===&lt;br /&gt;
The Play framework provides a hot deployment functionality. It means that code need not be compiled before deployment on the server. The developer can write the piece of code and directly hit refresh to execute the code. The compilation and execution happens at the time of deployment. Compilation errors, if any, are directly shown on the browser screen.&lt;br /&gt;
&lt;br /&gt;
Since, compilation and packaging happen at the time of deployment, Play does not have an elaborate development cycle. Although, two distinctive server modes are supported by Play. The '''DEV''' mode to be used for development purposes and the '''PROD''' mode when application is deployed. The main difference between the two modes is that hot reloading is not supported in the production mode.&lt;br /&gt;
&lt;br /&gt;
===IDE Support===&lt;br /&gt;
Since Play supports hot reloading, code can be typed on the fly and output can be received on the browser screen. Since there is no specific compilation phase involved, coding on Play framework does not require a [Integrated Development Environment (IDE) http://en.wikipedia.org/wiki/Integrated_development_environment]&lt;br /&gt;
Although code writing would not require the maximum usage of the IDE, activities like debugging and assisted refractoring in Java and Scala require the use of these sophisticated tools.&amp;lt;ref&amp;gt;https://www.playframework.com/documentation/2.4.x/IDE&amp;lt;/ref&amp;gt;&lt;br /&gt;
Play framework supports a host of famous IDE's like:&lt;br /&gt;
*Eclipse&lt;br /&gt;
A simple command &amp;lt;code&amp;gt;eclipsify&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;eclipse&amp;lt;/code&amp;gt; generates the required Eclipse configurations to convert the existing application to an Eclipse-ready one.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[my-first-play-app] $ eclipse&lt;br /&gt;
[my-first-play-app] $ eclipsify&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*IntelliJ&lt;br /&gt;
This IDE does not require a command prompt to setup the project configurations. It provides a direct Play2.x project selection while creating a new project. Only perquisite is that the Scala and Play 2 plugins are enabled in the IDE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors ,which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel.&lt;br /&gt;
&lt;br /&gt;
Below is the sample creation of code: &amp;lt;ref&amp;gt;http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The above actor &amp;lt;code&amp;gt;MyActor&amp;lt;/code&amp;gt; can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file.  &lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
The following is a summary of the pros and cons of the 2 Play versions:&amp;lt;ref&amp;gt;http://stackoverflow.com/questions/8189893/what-are-the-major-differences-between-play-framework-1-0-and-2-0&amp;lt;/ref&amp;gt; &lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Involves Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Inversion of Control&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=86960</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=86960"/>
		<updated>2014-09-19T21:59:53Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* Backward compatibility */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala. It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
&lt;br /&gt;
==Motivation==&lt;br /&gt;
*To create a stateless web framework&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*To have an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*To provide full-stack web framework&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with Ebean by default with the option to use any other persistence mechanism. JUnit, Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*To provide a developer friendly feature driven framework &lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to JSON and integration of compilers for CoffeeScript, LESS etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, RESTful by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&lt;br /&gt;
&lt;br /&gt;
*Play makes use of Akka which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up. &lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. Netty supports non - blocking I/O and hence it is not expensive to make such calls. &lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort. The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. The model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory is the directory that imparts the feature of configuration-over-convention to the framework. It contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
Play.application().configuration().getInt(&amp;quot;number&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Compilation Errors===&lt;br /&gt;
The Play framework provides a hot deployment functionality. It means that code need not be compiled before deployment on the server. The developer can write the piece of code and directly hit refresh to execute the code. The compilation and execution happens at the time of deployment. Compilation errors, if any, are directly shown on the browser screen.&lt;br /&gt;
&lt;br /&gt;
[[File:Play_compile_error2.jpg|thumb|center|alt=Compilation Error in play.|A compilation error shown on the browser screen]]&lt;br /&gt;
&lt;br /&gt;
Since, compilation and packaging happen at the time of deployment, Play does not have an elaborate development cycle. Although, two distinctive server modes are supported by Play. The '''DEV''' mode to be used for development purposes and the '''PROD''' mode when application is deployed. The main difference between the two modes is that hot reloading is not supported in the production mode.&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors ,which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The actor can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file.  &lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
&lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Inversion of Control&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=86956</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=86956"/>
		<updated>2014-09-19T21:56:14Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* MVC application model */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala. It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
&lt;br /&gt;
==Motivation==&lt;br /&gt;
*To create a stateless web framework&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*To have an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*To provide full-stack web framework&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with Ebean by default with the option to use any other persistence mechanism. JUnit, Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*To provide a developer friendly feature driven framework &lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to JSON and integration of compilers for CoffeeScript, LESS etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, RESTful by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&lt;br /&gt;
&lt;br /&gt;
*Play makes use of Akka which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up. &lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. Netty supports non - blocking I/O and hence it is not expensive to make such calls. &lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort. The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. The model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory is the directory that imparts the feature of configuration-over-convention to the framework. It contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
Play.application().configuration().getInt(&amp;quot;number&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Compilation Errors===&lt;br /&gt;
The Play framework provides a hot deployment functionality. It means that code need not be compiled before deployment on the server. The developer can write the piece of code and directly hit refresh to execute the code. The compilation and execution happens at the time of deployment. Compilation errors, if any, are directly shown on the browser screen.&lt;br /&gt;
&lt;br /&gt;
[[File:Play_compile_error2.jpg|thumb|center|alt=Compilation Error in play.|A compilation error shown on the browser screen]]&lt;br /&gt;
&lt;br /&gt;
Since, compilation and packaging happen at the time of deployment, Play does not have an elaborate development cycle. Although, two distinctive server modes are supported by Play. The '''DEV''' mode to be used for development purposes and the '''PROD''' mode when application is deployed. The main difference between the two modes is that hot reloading is not supported in the production mode.&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors ,which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The actor can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file.  &lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
&lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Iversion of Control&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=86933</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=86933"/>
		<updated>2014-09-19T21:43:32Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala. It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is it's ability to build highly scalable applications. It's reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
&lt;br /&gt;
==Motivation==&lt;br /&gt;
*To create a stateless web framework&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*To have an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*To provide full-stack web framework&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with Ebean by default with the option to use any other persistence mechanism. JUnit, Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*To provide a developer friendly feature driven framework &lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to JSON and integration of compilers for CoffeeScript, LESS etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, RESTful by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&lt;br /&gt;
&lt;br /&gt;
*Play makes use of Akka which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up. &lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. Netty supports non - blocking I/O and hence it is not expensive to make such calls. &lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort. The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. Th model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory is the directory that imparts the feature of configuration-over-convention to the framework. It contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
Play.application().configuration().getInt(&amp;quot;number&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Compilation Errors===&lt;br /&gt;
The Play framework provides a hot deployment functionality. It means that code need not be compiled before deployment on the server. The developer can write the piece of code and directly hit refresh to execute the code. The compilation and execution happens at the time of deployment. Compilation errors, if any, are directly shown on the browser screen.&lt;br /&gt;
&lt;br /&gt;
[[File:Play_compile_error2.jpg|thumb|center|alt=Compilation Error in play.|A compilation error shown on the browser screen]]&lt;br /&gt;
&lt;br /&gt;
Since, compilation and packaging happen at the time of deployment, Play does not have an elaborate development cycle. Although, two distinctive server modes are supported by Play. The '''DEV''' mode to be used for development purposes and the '''PROD''' mode when application is deployed. The main difference between the two modes is that hot reloading is not supported in the production mode.&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors ,which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve it's scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The actor can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file.  &lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
&lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Iversion of Control&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=86930</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=86930"/>
		<updated>2014-09-19T21:39:36Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala. It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architecture written in Scala. The primary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is its ability to build highly scalable applications. Its reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&lt;br /&gt;
&lt;br /&gt;
Some of the major companies that use Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
&lt;br /&gt;
==Motivation==&lt;br /&gt;
*To create a stateless web framework&lt;br /&gt;
Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
*To have an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture&lt;br /&gt;
Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
*To provide full-stack web framework&lt;br /&gt;
The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with Ebean by default with the option to use any other persistence mechanism. JUnit, Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
*To provide a developer friendly feature driven framework &lt;br /&gt;
One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to JSON and integration of compilers for CoffeeScript, LESS etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimic this and hence modeled Play on these frameworks.  Play is also fully compiled, typesafe, RESTful by default and provides support for long living connections(WebSocket, Comet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
*As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&lt;br /&gt;
&lt;br /&gt;
*Play makes use of Akka which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
*Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up. &lt;br /&gt;
&lt;br /&gt;
*Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
*Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&lt;br /&gt;
&lt;br /&gt;
*The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. Netty supports non - blocking I/O and hence it is not expensive to make such calls. &lt;br /&gt;
&lt;br /&gt;
*Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
*Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort. The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. Th model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;br /&gt;
&lt;br /&gt;
'''app/models'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes exhibiting typical Java behavior. Unlike the controllers, they follow the Java object oriented paradigm. This package contains the classes that represent the various actors in the use cases. All the corresponding operations pertaining to these actors are contained in the Model classes. The model classes access the data storage mediums to persist and update data.&lt;br /&gt;
&lt;br /&gt;
'''app/views'''&lt;br /&gt;
&lt;br /&gt;
This package contains special HTML, XML template files which are used to render the GUI on the user browser screen. The Play templating engine renders these views using special directives contained in these files. The Controller gets the data from the models and uses a template to decorate the views.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Standard Application Layout===&lt;br /&gt;
&lt;br /&gt;
'''The app directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains a sub folder for each of the layer in the MVC pattern. This is the directory under which the developers can add their code as well as HTML pages. Apart from the above mentioned packages, developers can create their own packages.&lt;br /&gt;
&lt;br /&gt;
'''The public directory'''&lt;br /&gt;
&lt;br /&gt;
This directory contains the static resources which are not modified by the framework. their state remains the same after deployment. These contain the image files, CSS files, [http://en.wikipedia.org/wiki/JavaScript JavaScript] files.&lt;br /&gt;
&lt;br /&gt;
'''The conf directory'''&lt;br /&gt;
&lt;br /&gt;
The conf directory is the directory that imparts the feature of configuration-over-convention to the framework. It contains all the configuration files required by the framework and the application. Two mandatory configuration files are:&lt;br /&gt;
&lt;br /&gt;
'''application.conf''' file: This file contains the standard configurations at time of application start up. Play provides a sophisticated API to read values from this file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Play.application().configuration().getString(&amp;quot;key&amp;quot;);&lt;br /&gt;
Play.application().configuration().getInt(&amp;quot;number&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''routes''' file: This file contains the configurable URLs. The routes defined here are mapped to controller functions which accept HTTP requests, render views etc.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET        /home                         Controllers.Application.index(Int ?= 2)&lt;br /&gt;
POST       /verifyuser                   Controllers.Login.verifyUser(String username)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Compilation Errors===&lt;br /&gt;
The Play framework provides a hot deployment functionality. It means that code need not be compiled before deployment on the server. The developer can write the piece of code and directly hit refresh to execute the code. The compilation and execution happens at the time of deployment. Compilation errors, if any, are directly shown on the browser screen.&lt;br /&gt;
&lt;br /&gt;
[[File:Play_compile_error2.jpg|thumb|center|alt=Compilation Error in play.|A compilation error shown on the browser screen]]&lt;br /&gt;
&lt;br /&gt;
Since, compilation and packaging happen at the time of deployment, Play does not have an elaborate development cycle. Although, two distinctive server modes are supported by Play. The '''DEV''' mode to be used for development purposes and the '''PROD''' mode when application is deployed. The main difference between the two modes is that hot reloading is not supported in the production mode.&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous==&lt;br /&gt;
===Asynchronous and Scalable programming===&lt;br /&gt;
The feature that makes Play a preferred framework for asynchronous and scalable applications is the inclusion of Akka toolkit. Instead of doing it the Java way of concurrency using threads, semaphores, and locks; Akka emphasizes upon actor-based concurrency. It implements the Actor model. The actors ,which are built on a fixed number of threads which is configurable, converse by the means of messages generated due to events. This helps Play achieve its scalability without having to handle it programatically.&lt;br /&gt;
Each actor consists of a mailbox and a queue. The mailbox registers the events and are passed as inputs to the actor. These actors, belonging to an actor system then process the messages and perform the assigned tasks in parallel. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import akka.actor.UntypedActor;&lt;br /&gt;
import akka.event.Logging;&lt;br /&gt;
import akka.event.LoggingAdapter;&lt;br /&gt;
 &lt;br /&gt;
public class MyActor extends UntypedActor {&lt;br /&gt;
  LoggingAdapter log = Logging.getLogger(getContext().system(), this);&lt;br /&gt;
 &lt;br /&gt;
  public void onReceive(Object message) throws Exception {&lt;br /&gt;
    if (message instanceof String) {&lt;br /&gt;
      log.info(&amp;quot;Received String message: {}&amp;quot;, message);&lt;br /&gt;
      getSender().tell(message, getSelf());&lt;br /&gt;
    } else&lt;br /&gt;
      unhandled(message);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The actor can be created by the following line of code below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ActorRef myActor = Akka.system().actorOf(new Props(MyActor.class));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also the number of actors initialized at application start up, by specifying a property in the application.conf file.  &lt;br /&gt;
&lt;br /&gt;
===Backward compatibility===&lt;br /&gt;
As shown in the History of Releases tab, Play framework got a complete overhaul after Play 2.0&lt;br /&gt;
The major difference turns out to be that Play 1.x was in Java while Play 2.x is in Scala. This renders it as backward incompatible.&lt;br /&gt;
This caused a lot of furor at the time of the release of 2.0 version as there was no portability script provided for migration from 1.x to 2.0. However, it was clearly seen that the advantages of this Scala version far outweighed the problems faced in application porting. &lt;br /&gt;
&lt;br /&gt;
'''Downsides of Play 1.x'''&lt;br /&gt;
*Bytecode manipulations&lt;br /&gt;
*Does not follow Java conventions&lt;br /&gt;
*Poor Iversion of Control&lt;br /&gt;
&lt;br /&gt;
'''Wins of Play 2.0'''&lt;br /&gt;
*Suited for asynchronous programming&lt;br /&gt;
*Improved and flexible cache support&lt;br /&gt;
*Convenient Data Access Layer for database requests&lt;br /&gt;
*Inclusion of Akka: Actor based, event driven framework&lt;br /&gt;
&lt;br /&gt;
===Play vs Java EE frameworks===&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=86117</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=86117"/>
		<updated>2014-09-17T19:43:32Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* Motivation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala. It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architectue written in Scala. The prmary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is its ability to build highly scalable applications. Its reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&lt;br /&gt;
&lt;br /&gt;
Some of the major names using Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
&lt;br /&gt;
==Motivation==&lt;br /&gt;
•	To create a stateless web framework – Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
•	To have an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture – Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
•	To provide full-stack web framework – The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with Ebean by default with the option to use any other persistence mechanism. JUnit, Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
•	To provide a developer friendly feature driven framework –   One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to JSON and integration of compilers for CoffeeScript, LESS etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimick this and hence modelled Play on these frameworks.  Play is also fully compiled, typesafe, RESTful by default and provides support for long living connections(WebSocket, Commet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
•	As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&lt;br /&gt;
&lt;br /&gt;
•	Play makes use of Akka which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
•	Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up. &lt;br /&gt;
&lt;br /&gt;
•	Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
•	Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&lt;br /&gt;
&lt;br /&gt;
•	The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. Netty supports non - blocking I/O and hence it is not expensive to make such calls. &lt;br /&gt;
&lt;br /&gt;
•	Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
•	Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort. The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. Th model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=86116</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=86116"/>
		<updated>2014-09-17T19:43:00Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* Motivation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala. It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architectue written in Scala. The prmary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is its ability to build highly scalable applications. Its reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&lt;br /&gt;
&lt;br /&gt;
Some of the major names using Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
&lt;br /&gt;
==Motivation==&lt;br /&gt;
&amp;lt;ins&amp;gt;To create a stateless web framework –&amp;lt;/ins&amp;gt; Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;ins&amp;gt;To have an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture –&amp;lt;/ins&amp;gt; Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ins&amp;gt;To provide full-stack web framework –&amp;lt;/ins&amp;gt; The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with Ebean by default with the option to use any other persistence mechanism. JUnit, Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ins&amp;gt;To provide a developer friendly feature driven framework –&amp;lt;/ins&amp;gt; One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to JSON and integration of compilers for CoffeeScript, LESS etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimick this and hence modelled Play on these frameworks.  Play is also fully compiled, typesafe, RESTful by default and provides support for long living connections(WebSocket, Commet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
•	As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&lt;br /&gt;
&lt;br /&gt;
•	Play makes use of Akka which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
•	Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up. &lt;br /&gt;
&lt;br /&gt;
•	Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
•	Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&lt;br /&gt;
&lt;br /&gt;
•	The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. Netty supports non - blocking I/O and hence it is not expensive to make such calls. &lt;br /&gt;
&lt;br /&gt;
•	Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
•	Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort. The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. Th model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=86114</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=86114"/>
		<updated>2014-09-17T19:40:11Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* Motivation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala. It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architectue written in Scala. The prmary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is its ability to build highly scalable applications. Its reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&lt;br /&gt;
&lt;br /&gt;
Some of the major names using Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
&lt;br /&gt;
==Motivation==&lt;br /&gt;
To create a stateless web framework – Traditional web frameworks are stateful and because of this scalability becomes an issue after a while. The creators of the Play framework found that stateless frameworks are more stable when there is higher traffic since no overhead is incurred in tracking and maintaining user state information. &lt;br /&gt;
&lt;br /&gt;
To have an ‘evented’ web server architecture as opposed to a ‘threaded’ web server architecture – Since the Play framework is essentially stateless, an event driven web server architecture was more appropriate to base Play on than modelling it as threaded. Therefore, it was decided to base play on Netty – an event-driven client-server framework.&lt;br /&gt;
&lt;br /&gt;
To provide full-stack web framework – The creators of the framework wanted to provide developers with a single complete framework that was capable of model-persistence and which had template (view), controller and testing mechanisms. In Play, model and controller can be realized with Java and Scala, views are realized with a template syntax and Scala and model persistence is done with Ebean by default with the option to use any other persistence mechanism. JUnit, Selenium WebDriver and FluentLenium are mainly used as the testing tools for Play.&lt;br /&gt;
&lt;br /&gt;
To provide a developer friendly feature driven framework –   One of the primary motivations of the Play framework was to make development as easy as possible for the developer. To do this features such as hot reload (mimicking interpreted languages), integration to JSON and integration of compilers for CoffeeScript, LESS etc. were provided. Development on Ruby on Rails and Django is fairly simple and the creators of Play wanted to mimick this and hence modelled Play on these frameworks.  Play is also fully compiled, typesafe, RESTful by default and provides support for long living connections(WebSocket, Commet etc).&lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
•	As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&lt;br /&gt;
&lt;br /&gt;
•	Play makes use of Akka which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
•	Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up. &lt;br /&gt;
&lt;br /&gt;
•	Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
•	Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&lt;br /&gt;
&lt;br /&gt;
•	The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. Netty supports non - blocking I/O and hence it is not expensive to make such calls. &lt;br /&gt;
&lt;br /&gt;
•	Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
•	Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort. The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. Th model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=86113</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=86113"/>
		<updated>2014-09-17T19:38:08Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: /* Features of Play Framework */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala. It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architectue written in Scala. The prmary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is its ability to build highly scalable applications. Its reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&lt;br /&gt;
&lt;br /&gt;
Some of the major names using Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
&lt;br /&gt;
==Motivation==&lt;br /&gt;
Play framework &lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
•	As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&lt;br /&gt;
&lt;br /&gt;
•	Play makes use of Akka which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
•	Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up. &lt;br /&gt;
&lt;br /&gt;
•	Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
•	Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&lt;br /&gt;
&lt;br /&gt;
•	The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. Netty supports non - blocking I/O and hence it is not expensive to make such calls. &lt;br /&gt;
&lt;br /&gt;
•	Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
•	Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort. The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. Th model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=86111</id>
		<title>CSC/ECE 517 Fall 2014/ch1a 1 sj</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2014/ch1a_1_sj&amp;diff=86111"/>
		<updated>2014-09-17T19:36:53Z</updated>

		<summary type="html">&lt;p&gt;Jlourde: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Play Framework''' is a high velocity web development framework for Java and Scala. It uses the [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller Model-view-controller] (MVC) architectural pattern for implementing user interfaces. Play is based on a lightweight, stateless and web-friendly architectue written in Scala. The prmary goal of Play framework is to provide a developer friendly development platform for web development.&lt;br /&gt;
&lt;br /&gt;
The major advantage of Play over other Java EE frameworks is its ability to build highly scalable applications. Its reactive model ([http://www.reactivemanifesto.org/ Reactive Manifesto]), thanks to Iteratee IO provides nominal consumption of resources (CPU cores, memory), a major requirement for ascendable and asynchronous applications.&lt;br /&gt;
&lt;br /&gt;
Some of the major names using Play framework are [https://www.linkedin.com/ LinkedIn], [https://klout.com/home Klout], [http://www.theguardian.com/us TheGuardian], [http://www.zaptravel.com/ ZapTravel] and [http://www.gilt.com/ GILT]&lt;br /&gt;
&lt;br /&gt;
==Motivation==&lt;br /&gt;
Play framework &lt;br /&gt;
&lt;br /&gt;
==Features of Play Framework==&lt;br /&gt;
As mentioned before, Play is a stateless, light weight framework which is very flexible. The MVC architecture inherently provides flexibility but along with this there are many elements in Play which are pluggable, configurable or customizable.&lt;br /&gt;
&lt;br /&gt;
Play makes use of Akka which supports multiple programming models for message based asynchronous concurrency. As a result of this, even large scale applications built on Play consume minimum resources in terms of CPU, memory and threads.&lt;br /&gt;
&lt;br /&gt;
Another advantage that Akka provides to Play is predictable scalability. The asynchronous model of Akka coupled with the stateless, non-blocking I/O nature of Play ensures that there are no hiccups while scaling up. &lt;br /&gt;
&lt;br /&gt;
Development on Play is simple and straight forward. Owing to features such as hot reload, powerful console &amp;amp; build tools, type safety, built in testing tools and IDE support for Eclipse &amp;amp; IntelliJ IDEA all that is required for development would be a browser and a text editor. This enhances the productivity of developers dramatically.&lt;br /&gt;
&lt;br /&gt;
Play provides many features for modern web and mobile app development. Being RESTful by default, integration for JSON and compilers for CoffeeScript, Less etc., support for protocol technologies such as WebSocket &amp;amp; Comet and extensive NoSQL &amp;amp; Big Data support are just some of these features.&lt;br /&gt;
&lt;br /&gt;
The reactive nature of Play is another important feature. Apps developed based on a Service oriented architecture would require multiple parallel asynchronous requests to be sent out. Netty supports non - blocking I/O and hence it is not expensive to make such calls. &lt;br /&gt;
&lt;br /&gt;
Play is open source which allows for evaluation of the underlying code and also facilitates monitoring of the framework code.  There is also a large user community who contribute libraries and help clarify the doubts of fellow users. But, even though play is open source, there is an option to receive commercial support.&lt;br /&gt;
&lt;br /&gt;
Play provides a developer friendly error handling mechanism where the error is directly mentioned in the browser itself with the file path, line number as well as the relevant code. This saves a lot of developer time and effort since he/she would not have to dig through and analyze large log files. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
The early versions of Play framework can be traced back to early 2007 while it was being developed at Zenexity by software developer Guillaume Bort. The first full version of Play was in October 2009. Later in 2011, Sadek Drobi, co-creator of Play, joined the Play development wagon to release Play 2.0 in conjunction with [http://en.wikipedia.org/wiki/Typesafe_Inc. Typesafe] Stack 2.0.&lt;br /&gt;
===Release History===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Release Version !! Date of Release !! Features&lt;br /&gt;
|-&lt;br /&gt;
| Play 1.x || November 2010 - April 2011 || &lt;br /&gt;
*Native Scala Support&lt;br /&gt;
*Migration from Apache MINA to JBoss Netty&lt;br /&gt;
*[http://en.wikipedia.org/wiki/OAuth OAuth] and [http://en.wikipedia.org/wiki/HTTP_Secure HTTPS] support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.0 || March 2012 ||&lt;br /&gt;
*Native Support for Java and Scala&lt;br /&gt;
*Asynchronous programming support by inclusion of [http://en.wikipedia.org/wiki/WebSocket WebSockets] and [http://en.wikipedia.org/wiki/Comet_(programming) Comet]&lt;br /&gt;
*Built-in relational database access libraries such as [http://en.wikipedia.org/wiki/Ebean Ebean], [http://en.wikipedia.org/wiki/Java_Persistence_API JPA] and [https://www.playframework.com/documentation/2.1-RC2/ScalaAnorm Anorm]&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.1 || Februrary 2013 ||&lt;br /&gt;
*Migration to Scala 2.10 API&lt;br /&gt;
*[http://requirejs.org/ RequireJS] support&lt;br /&gt;
*New Scala JSON API&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.2 || September 2013 ||&lt;br /&gt;
*Improved [http://en.wikipedia.org/wiki/Futures_and_promises Java Promise] API&lt;br /&gt;
*SBT 0.13 support&lt;br /&gt;
*Built in Gzip support&lt;br /&gt;
|-&lt;br /&gt;
| Play 2.3 || May 2014 ||&lt;br /&gt;
*Introduced [https://typesafe.com/activator Activator] command&lt;br /&gt;
*Support for Scala 2.11&lt;br /&gt;
*Custom SSL Engine for HTTPS&lt;br /&gt;
*Upgrade to [http://en.wikipedia.org/wiki/Netty_(software) Netty] 3.9.3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Architecture==&lt;br /&gt;
===MVC application model===&lt;br /&gt;
Play follows a typical MVC architectural design pattern of web application development. This divides the application into '''two''' broad layers:&lt;br /&gt;
*The Model Layer: It handles the business logic of the actual domain problem. &lt;br /&gt;
*The Presentation Layer: This can be categorized into two sub parts.&lt;br /&gt;
**The View: It handles the actual GUI of the application&lt;br /&gt;
**The Controller: It maps the actions on the user interface to the concerned models.&lt;br /&gt;
&lt;br /&gt;
The '''Model''' refers to the entities involved in the real world domains. It captures the actual data and applies the programming logic to it. The model operates on the raw data and adds &amp;quot;meaning&amp;quot; to it. Generally this data is stored in a persistent storage medium, like a database. Th model interacts with this data by means of a Data Access Layer which is encapsulated by it.&lt;br /&gt;
&lt;br /&gt;
The '''View''' refers to the actual [http://en.wikipedia.org/wiki/Graphical_user_interface Graphical User Interface(GUI)] displayed on the browser. This is the interface with which the user connects to the application. The data is inputted into the application using the interface provided by the view. It is usually displayed in the browser using [http://en.wikipedia.org/wiki/HTML HTML], [http://en.wikipedia.org/wiki/Cascading_Style_Sheets CSS] and [http://en.wikipedia.org/wiki/JSON JSON] formats. It acts as the single point of access to the application for the end user.&lt;br /&gt;
&lt;br /&gt;
The '''Controller''' maps the user actions (events) to the concerned models and invokes the required changes in them. It processes the events and affects the behavior of the underlying models. Typically, in a web application, the events generated are HTTP/HTTPS requests. The responsibility of the controller is to act as a filter for the HTTP requests, process them, extract relevant information and pass it to the concerned entities.&lt;br /&gt;
&lt;br /&gt;
[[File:Diagrams_mvc.png|frame|center|alt=A typical MVC architectural design pattern.|MVC architectural pttern.]]&lt;br /&gt;
&lt;br /&gt;
In a Play application, these three components are placed in the '''app''' directory, each in a separate package.&lt;br /&gt;
&lt;br /&gt;
'''app/controllers'''&lt;br /&gt;
&lt;br /&gt;
These are the Java classes that receive the HTTP requests. They are extended form the &amp;lt;code&amp;gt;play.mvc.Controller&amp;lt;/code&amp;gt; class. Each HTTP request is attached to a '''action''' method. This is a public and static method having the following signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static void action_name(params...);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Various parameters can be defined as inputs to the action methods. Play automatically maps them from the corresponding HTTP request parameters. There is generally no limit on the number of parameters to be passed and they can also be sent as query strings.&lt;/div&gt;</summary>
		<author><name>Jlourde</name></author>
	</entry>
</feed>