Book Image

Instant Play Framework Starter

By : Daniel Dietrich
Book Image

Instant Play Framework Starter

By: Daniel Dietrich

Overview of this book

Play is a full-featured Java and Scala web framework for building modern, high-performance web applications. It is characterized by its simplicity and scalability. With its lightweight, stateless, and web-friendly architecture, Play focuses on developer experience to make web application development fun.Instant Play Framework Starter is the ideal companion to start developing web applications with Play. The building blocks of a typical web application are carefully designed following an on-going example.Instant Play Framework Starter starts with a quick setup and running a first sample. Then, the anatomy of a typical Play application is outlined. More features are added step by step to an example application. The result is the prototype of a highly scalable web application.The example is implemented in Java and in Scala. It consists of building blocks you will find in every Play application. In particular, you will learn how views are rendered with the template engine, how HTTP routes are used to define the navigation rules, and how to separate the application logic of controllers from the business logic of the model. This separation is the result of a careful application design, which makes it easy to add features like data binding and validation. Finally you will see how easy it is to adapt different database access libraries. Instant Play Framework Starter will help you to get started with Play and develop your first application. Packed with examples, it is easy to follow the design of a real-world application. You are able to compare the difference between a Java- and a Scala-based Play application and to decide which language fits your needs best. All topics covered in the book are described with the aim to serve as a reference for future web application development with Play.
Table of Contents (7 chapters)

So, what is Play?


Play is a full-stack web framework created to make web application development on the JVM easier and more productive. It provides APIs for Java and Scala.

A full-stack web framework provides solutions for a wide range of time-consuming web development tasks. With Play, developers are focusing on implementing functionality instead of thinking about design and architecture, and re-inventing the wheel. Only a few lines are necessary to write a fully functional web application.

Traditional web frameworks running on the JVM tend to create an abstraction layer over another abstraction layer. These heavy-weight lasagne architectures introduce an additional technical boilerplate and configuration, distracting developers from reaching their goal. Play in turn reduces complexity and simplifies web development by aligning its architecture with the that of the web, instead of abstracting it away.

Users of the Play Framework are web developers. Developers care about code readability and maintainability, fast development cycles, and easy error recovery. Play was designed by web developers to meet these goals.

Play consists of well-known parts. The basic architecture of a Play application follows the model-view-controller pattern, having an HTTP interface at its heart. Cohesive controllers and composable views share the same model.

Code changes are made visible by a simple reload of the web page in the browser. Play takes care of compiling changes in the background, independent of the development environment. This makes the development turnaround fast and easy.

Play also takes care of errors. Developers don't have to read long JVM stack traces to locate an error. Instead, Play shows the significant information directly in the browser, leading the developer right to the origin of the error. It is a big advantage that Play is a JVM framework; almost all parts of a Play application are type-safe.

This is why it is fun to develop Play applications.