An Overview of Play Framework

Play framework is a full stack web framework for Java. Play focuses on programmers targets and productivity. It is an excellent companion for disciplined project management process. It’s aim is to lighten web applications development as long as attach with Java. Its best feature is that the code changes are identified and reloaded by the development web server. Play is a perfect Java framework. It allows you to manage your favorite libraries and development tools.

Fix the bug and hit Reload

The framework compiles the Java source codes and reloads them into the JVM directly. You can then edit, reload and see the modifications immediately, without the need to restart the server. So if you want, you can skip a full-featured Java IDE and work with a simple text editor. When an error occurs, the framework recognize it and shows the problem. Even the stack traces are displayed down and it makes easier to resolve the problems.

Simple stateless MVC architecture

Component based and state full Java Web framework can save page state automatically, but it has lot of other difficulties like if the user opens a second window or hits the browser back button.

As the browser developed into more powerful, this is the best option to use offline storage or Ajax to resolve the client-side state problems.

HTTP-to-code mapping

A Web application framework should provide you straightforward,full access to HTTP and its concepts, which is the main difference between other Java web application frameworks and Play. And the Request/Response pattern, HTTP, content-type negotiation, the REST architectural style, URI are all important ideas for the play framework.

Efficient template engine

The template system of Play is very efficient which allows to generate HTML, XML, JSON or any text based format document dynamically. The expression language of the template engine is Groovy. To create re-usable functions, you can use a tag system. All the Templates are saved in the directory – app/views.

JPA with Play

JPA (The Java Persistence Architecture) is the finest Object Relational Mapping API applicable for Java. If you are familiar with JPA, it will be very simpler with Play. No configuration is needed, the framework will start the Entity Manager of JPA automatically and when the code is reloaded, it synchronizes marvelously. In addition, if you use the superclass play.db.jpa.Model it will help in making your code attractive.

Test driven development

To make your application very powerful, it is a good way to create automatic test suites. It provides you to work in a very active way. Depending on what you need to test, the play framework tests are set up using Selenium or Junit 4. All kinds of tests can be written, from full acceptance tests to simple unit tests and can run them directly using Selenium in a browser.

Full-stack application framework

The initial inspiration of the play framework was our own Java applications and it has all the components required to build a modern web application such as, relational database support through JDBC, Hibernate (with JPA API) to remain your Java objects in the Database, Integrated Cache support, Direct Web services utilization either in XML or JSON, Image manipulation API, OpenID support used for distributed authentication.

The modular architecture of play framework allows you to integrate a web application with many others. So you can reuse your java code, static resources like Javascript and CSS files and templates in an easy way.