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

Persisting them

At this stage, we have learned the functionalities offered by Play! 2 to represent our data on both sides (server and client). However, that data was all transient. Indeed, the HTML form was submitting data to an action that rendered them directly.

In a web application, most data isn't transient, but persistent—data is the value of modern applications (moreover, social-oriented ones).

If we remember the structure of our User model, it includes two references to other users: one optional (spouse) and one multiple (friends). Such data must come from somewhere other than the User form, because the actual form is only defined for a single user.

This implies a third piece in our architecture, a database, in order to retrieve previously ...

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