liveBook · Manning

Data model

As explained in Data-Oriented Programming: Reduce software complexity

A data model is a structured representation of the data entities, fields, values, and relationships in a system.

A data model separates data design from code. In a library management system, begin with entities such as Book and Author, refine their fields, and make every relationship explicit. section 3.1

A data-oriented model represents records as heterogeneous string maps. Their values can be primitives, positional collections, or indexes, with composition and association connecting records. section 3.6

Design the model by asking:

  • How will each relationship be represented rather than merely drawn? section 3.1
  • Which information paths expose the needed fields and nested values? section 3.6
  • Is the flexibility of adding, removing, or renaming fields worth giving up compile-time safety? section 3.6

Book and Author

A many-to-many Book–Author association can use a collection of author IDs in each Book record and a collection of book IDs in each Author record. The relation remains data rather than class-defined behavior. section 3.1

Figure 3.3 Library management relation model. Dashed lines (e.g., between Book and Author) denote indirect relations, [String] denotes a positional collection of strings, and {Book} denotes an index of Books.

Use the relation model to inspect direct and indirect relationships, positional collections, and indexed records at a glance. section 3.1

How Data-Oriented Programming: Reduce software complexity covers it

How deep it goes
Descends from entity diagrams to record structures, relationship representation, information paths, and runtime field changes.
Examples
Uses a Library Management System with Book–Author associations, identifier collections, positional collections, and indexed records.
What it assumes
Builds from familiar entity diagrams and OOP associations while teaching generic data representations.
What you can do after
Apply it via generic functions such as Lodash get, has, merge, values, filter, and map.
How it connects
Connects records with generic data structures, composition, association, information paths, generic functions, and JSON serialization.

Also explained in

Compare how 23 books explain data model →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Data-Oriented Programming: Reduce software complexity. The section links point to the parts of the book it draws on.