Course info
Apr 14, 2014
1h 37m

Play! 2 for Scala aims to allow developers to build modern web applications that allow them to take full advantage of commodity cloud infrastructure to produce highly scalable, fault-tolerant applications. This course will act as a high level introduction to the various features of Play! 2 that will allow you to take full advantage of this modern web framework.

About the author
About the author

James Hughes is a Consultant at Kainos working on anything and everything. He is also Kainos Developer Evangelist helping to build an engaged and interested community in Northern Ireland and London.

More from the author
Play! 2 for Java
1h 40m
Nov 6, 2013
Section Introduction Transcripts
Section Introduction Transcripts

Hello, and welcome to the Play! 2 for Scala course. This module will introduce you to both the course plan and the Play! framework itself. Let's start by going over what you can expect from this course, the module outline, and a quick introduction of what we are going to build along the way to demonstrate the various topics. Then, we'll begin focusing on the Play! framework itself. We'll explain the history behind Play! and how it has evolved. We'll look at the overall philosophy, its roots in non-blocking, stateless, asynchronous, highly scalable principles, and we'll look at the overall architecture and structure of the technology.

Starting Up
Hello, and welcome to the Play! 2 for Scala course. In this module, we will look at getting started with Play! 2. We'll begin by using the Play! 2 website to download the latest version of Play! . We'll add the Play! binaries to our system path so that we can run the Play! command from anywhere. Next, we'll use the Play! command to generate and run a basic Play! application. From here, we'll look at the other common tasks that we'll use the Play! command for. We'll explore the structure of the generated project to get a high level view of how Play! applications fit together. Finally, we'll look at how the Play! command allows us to generate the necessary project files for opening our application in IDE's such as Eclipse and IntelliJ's idea.

Hello, and welcome to the Play! 2 for Scala course. In this module, we will look at how Play! deals with request routing. We'll start by looking at the role of the router and why that's important. We'll see how the basic mechanics of a router work. We'll then look into the DSL or domain-specific language provided by Play! for defining routes. We'll cover a few of the DSL aspects such as basic syntax of a route definition, defining dynamic URI parts via tokens, clobbing, a fancy name for grouping, and regular expressions, specifying types and defaults for dynamic parts and route priority. Finally, we'll look briefly at reverse routing and how Play! provides type safe routing via it's domain-specific language.

Controllers, Actions, and Results
Hello, and welcome to the Play! 2 for Scala course. In this module, we will look at Play! 's actions, controllers, and results. We'll begin by looking into controllers in Play! and what features they offer us. This will lead us nicely into actions, Play! 's primary concept for handling incoming requests. We'll then look into Results, an abstraction that Play! uses to describe responses going back to the calling client. From here, we'll look into Session and Flash Scope as a means for sharing information across multiple request responses. Finally, we'll look at the basic structure of the request and the response objects available to actions. Once we've covered these core topics, we'll take this knowledge and use it to implement the basic structure and flow of a sample application.

Hello, and welcome to the Play! 2 for Scala course. In this module, we're going to look at views in Play! . We'll look at how a Play! view is constructed, how to pass arguments from a controller action into the view. We'll look at how we achieve iteration and conditional logic in views. We'll look at reuse in views via partials and layouts. And finally, we'll look at hard to access session and flash objects in the views themselves.

Data Access
Hello, and welcome to the Play! 2 for Scala course. In this module, we are going to look at working with data in Play! from both the data persistence and UI angle. We'll start by looking at data persistence in Play! . This includes an overview on how Play! approaches data access, a primer on basic data access using ANORM, an ORM that can be used alongside Play! , and a look at database migration support in Play! . Then we'll move on to looking at how you can interact with the data layer. We'll see how you can use form objects to convert our domain models to and from HTTP requests, as well as providing validation. Along the way, we'll also see how we can use Play! 's view helpers to quickly build forms that include help text and validation messages.

The Global Object
Hello, and welcome to the Play! 2 for Scala course. In our final module, we are going to look at the global object, a hook for controlling global events in our application. We'll start by going over the high-level features of the global object, such as looking at the options for wiring functionality into key stages of the application lifecycle, such as when the application is starting and shutting down and when an unhandled error occurs. Then we'll move down a level and see how various events in the request/response lifecycle can be handled, such as intercepting requests, handling not found responses, and handling issues with malformed routes. Then we'll look at a few other common handlers available. After this, we'll look at a few more complete examples of the important and commonly-used features of the global object.