Appendix A. Introducing Play! Framework 2

In this appendix, we'll spend some time speaking about Play! Framework 2 itself rather than exposing what it can do, which, by the way, was the role of the book's main content.

The following topics will be covered in this appendix:

  • What is, in fact, Play! Framework 2, and what are the use cases that will fit perfectly with this framework
  • A glance on the core ideas
  • Why the need for such a framework was so strong that it already has a second version of it
  • Why the second version is better than the first, and what the differences are
  • A quick overview of the goodies given to developers

Why do we need Play! Framework?

The first thing to understand and to keep in mind while using Play! Framework 2 is that it is a pure and full-stack web framework on the JVM. Creating web applications using cutting-edge technologies is its first purpose, and it is the best at it. It is the best as it gives developers a great and positive experience while creating web applications. This experience comes with the fresh and neat vision that Play! Framework has on how web development should be done.

The most appreciated feature from the developer's perspective is the short overhead between the code session and the result in a web page, which is near to zero, thanks to the hot reloading of any source files and the compilation errors shown in the browser.

Framework for the Web

This new framework has been built by taking some references from the Web world and its success stories. Some of them are Ruby on Rails or Django in Python. They bring to the JVM some facilities that aim at simplification of the work; for instance, eliminating the boilerplates necessary to set up a development environment around the framework.

Indeed, its full-stack approach means everything is prepared for us—all we need is already there. Not that we're forced to use everything or we cannot swap a library for another, but it's just that without specific actions and efforts by the web developer, we don't have to do anything else but simply install the framework and start working. And it's on the JVM—that means we have all the tools from one of the biggest communities out there to help us in our daily work.

In short, Play! Framework 2 is the fastest way to create amazing applications that make usage of all new features brought by the Web. Thus, it's also the best way to show these new features!

Not JEE-based, but JVM

We have to mention that Play! 1 didn't follow the JEE specifications and abstractions, and there are no reasons to have Play! 2 follow them either. Where most of the abstractions in J2EE, at some point, eased the developer's work, nowadays they are constraining him/her with what was foreseen years ago. But the Web is evolving so fast, with needs that are completely different than were half a decade ago or so.

For instance, every year HTML5 has better support, and this specification along with the Web is including many new features that help in building applications very easily and in an integrated way. Examples are WebSockets, caching control, security headers or metadata, and so on. While these features have to be enabled in JEE, they haven't been hidden in Play! 2.

Learning from the past, where the first version supported the Scala language through a plugin, this new version has been built upon Scala from the beginning. Because Scala and the functional paradigm fit very well with highly-concurrent applications, like a web framework should be, they both helped a lot for Play! 2 to be a highly-reactive web framework.

However, even if Scala is gaining in reputation, the Java community with its tooling and its amazing set of libraries, and also its "quasi-omnipresence" still has a place of choice; that's why a Java-specific and adapted API is there for us. This might enable a developer to mostly ignore the Scala language itself, apart from the templating and build system.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset