liveBook · Manning

Record

As explained in Data-Oriented Programming: Reduce software complexity

A record is a data structure that groups related fields, potentially containing values of different data types.

A record groups related data items into fields, which may hold different data types. In data-oriented programming, a record is represented as a heterogeneous string map rather than a class instance. section 3.1 section 3.2

A record fits into a data model alongside other generic structures:

  • Store primitive values, positional collections, or indexes as record values. section 3.1
  • Use string keys to access fields through information paths such as ["booksByIsbn", "978-1779501127", "title"]. section 3.3
  • Manipulate records with generic functions, trading compile-time safety for flexibility and genericity. section 3.0 section 3.6
  • Usually identify a record by the fields or indexes relevant to an operation rather than by maintaining explicit type information. section 3.5

A Book record as a map

A Book record can contain an ISBN, title, publication year, author identifiers, and book items. A generic lookup retrieves its title with _.get(catalogData, ["booksByIsbn", "978-1779501127", "title"]), producing "Watchmen".

How Data-Oriented Programming: Reduce software complexity covers it

How deep it goes
Defines fields, map representation, information paths, type handling, and flexibility-safety tradeoffs, while deferring state changes.
Examples
Demonstrates Book, Catalog, UserManagement, librarian, member, and nested book-item records through maps and Lodash operations.
What it assumes
Assumes separation of code and data, while teaching records, collections, indexes, and heterogeneous maps from their basic definitions.
What you can do after
Apply via generic functions by modeling entities as maps, navigating information paths, and querying fields without class-specific code.
How it connects
Connects records with maps, arrays, positional collections, indexes, generic functions, information paths, and data validation.

Also explained in

Compare how 12 books explain record →

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.