O'Reilly logo

Serverless Single Page Apps by Ben Rady

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

Defining the Data Model

It’s a common practice when building web applications to use object-oriented JavaScript[30] to define a data model. First, you create JavaScript classes (which are actually just functions) that use prototypical inheritance[31] to model your problem. You then create graphs of these objects in order to store your data and perform operations on it. If we were using that approach for this app, we’d probably wind up with Problem objects, which might have included a checkSolution function that accepted another object type (maybe Solution) as a parameter. Both of these object types might inherit persistence and serialization behavior from another object type (maybe Entity or Model).

With this app, we’re going to take a different ...

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