Summary

This chapter was really exciting. We've seen how Play! Framework 2 is there for us when we have to bring advanced features to the client side.

We saw how a dynamic list of a single parameter is easily defined and used on both sides: client and server. This is thanks to the Form API and the Scala template helpers.

We also took the opportunity to quickly introduce CoffeeScript, which is like a beefed-up JavaScript, avoiding a lot of boilerplates or common errors with JavaScript.

With that in mind, it was so easy to poll the server in order to fetch the information that must be updated asynchronously on the current view, without requesting any actions from the user perspective.

We enjoyed the way we can have a predictable and checked generation of our URLs without having to hardcode anything, even in the CoffeScript world! This has helped us a lot in aggregating features in a single component, as we were able to compose validated URLs on the client side.

We finally moved to real time, using WebSocket and Akka. Akka was there to ease the definition of recurrent tasks, whereas WebSocket offered a standardized way of dealing reactively with clients. We especially noticed how easy it was, thanks to a clean and light API that Play! 2 has defined over such difficult use cases.

Along the way, we built an application, chatrum, that enables the user to configure several chatrooms he/she would like to interact with—in real time.

This application is still missing a last point to match the standard of today's web applications: an open door to the external world using web services offered by third parties. We all have the Twitter or Facebook ones in our mind, so let's see how we could integrate them into our application in the next chapter.

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

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