Search⌘ K

JavaScript Entity Table Model

Explore how to build a JavaScript entity table model that manages class hierarchies and persistent data using the browser's local storage. Understand different inheritance approaches such as Single Table Inheritance and Table per Class Inheritance, and learn to organize your data tables effectively for front-end applications without foreign key support.

We'll cover the following...

Make a JS entity table model

Since we use the browser’s local storage as the persistent storage technology for our example application, we need to deal with simple key-value storage. For each design model class that has a singular and capitalized name (for example, Entity), we use its pluralized lowercase name (entities) as the corresponding table name. We also use it as a key. Its associated string value is obtained if we serialize the object collection method Entity.instances with the help of the JSON.stringify method.

We design a set of suitable JS entity tables in the form of a JS entity table model that we derive from the information design model. We need to make certain choices about how to organize our data store and how to derive a ...