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 ...

Get Serverless Single Page Apps now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.