O'Reilly logo

Learning Play! Framework 2 by Andy Petrella

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Porting to Scala

Until now, in this chapter, we have talked about the Java API that Play! 2 provides to deal with data, nevertheless there is also a Scala version. We'll have a quick overview here by implementing the same workflow (validation, forms, persistence).

Actually, both APIs look the same, but in Scala, binding is very often our job, whereas in Java, it was the job of the reflection-based tools—Scala doesn't have many tools like that, but times are changing with its 2.1 release.

The first impact regarding this is that, in Scala, binding form instances is our responsibility. Then there is the communication with the database, where in Java, we had the Model class helping us to deal with the Ebean ORM. On the other hand, the Scala database ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required