architect-handbook

Software Architect Handbook

View on GitHub

Record Set

An in-memory representation of tabular data.

Overview

For a long time, the dominant way to represent data in a database has been the tabular relational form. On top of this has come a wealth of tools for building UI’s quickly that rely on the fact that the underlying data is relational, and they provide UI widgets fof various kinds that make it easy to view and manipulate this data with almost no programming.

The idea of the Record Set is to provide an in-memory structure that looks exactly like the result of an SQL query but can be generated and manipulated by other parts of the system.

How It Works

When to Use It

The value of Record Set comes from having an environment that relies on it as a common way of manipulating data. A lot of UI tools use Record Set, and that’s a compelling reason to use them yourself.

If you have such an environment, you should probably use Table Module to organize your domain logic:

  1. Get a Record Set from the database.
  2. Pass it to a Table Module to calculate derived information.
  3. Pass it to a UI for fisplay and editing
  4. Pass it back to a Table Module for validation.
  5. Commit the updates to the database.