Scala-specific

In this section we'll try to, somehow, list what can be used in the Scala world.

First, at the time of writing, Play! Framework 2 integrates ANORM as the default library for accessing relational databases. This library has been built internally with Play! and so is packaged with the distribution. Even if it lacks documentation at this stage, it has a good vision about how to access databases functionally using Scala. More information can be found at http://www.playframework.org/documentation/2.0.4/ScalaAnorm.

However, now that Play! Framework 2 is part of the Typesafe stack, it will be worth considering Slick too. Slick is the database access layer that is currently built at Typesafe and takes advantage of the new features of Scala in its 2.10 release.

As the next release of Play will be based on this Scala version, Slick will also be available. Note that their visions are completely different; on the one side, Slick tries to enable an intuitive DSL integrated with the object model to deal with backend systems (relational and otherwise), while ANORM is not an object relation mapper, and so you're responsible for writing the SQL all by yourself (only relational).

Furthermore, the Slick documentation is gaining some muscle and reaching a good level; it is available at http://slick.typesafe.com/docs/.

For very advanced workflows using the requests' bodies or resource handling in general, it's important to understand the concept of Iteratee . There are plenty of great blogs about it on the Web, some dedicated to Scala developers, others for those familiar with imperative coding. But the first page to look at is the internal documentation page at http://www.playframework.org/documentation/2.0.4/Iteratees.

Although not really related to Scala (but Scalaers are more familiar with these concepts), Akka is another great toolkit to master in order to enhance an application with completely distributed computation or advanced concurrent workflows. Even if both the Scala and the Java APIs are amazing, knowing Scala (of a functional programming language) helps a lot understanding the core ideas such as Message Passing Style or Actors. Luckily, the Akka team is maintaining great documentation that closely follows any new features or changes. It is available at http://doc.akka.io/docs/akka/2.0.4/. Don't skip the general section!

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

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