liveBook · Manning

State reference

As explained in Data-Oriented Programming: Reduce software complexity

A state reference is a mutable reference identifying the version of system data that currently represents the system state.

A state reference identifies which version of the system data currently represents the system state. The data stays immutable; the reference changes. section 4.1

Moving the system forward

After mutation B, the state reference points to Data V12. After mutation C, it points to Data V13. The versions share unchanged structure rather than requiring deep copies, so earlier versions can remain available when history matters. section 4.1

How Data-Oriented Programming: Reduce software complexity covers it

How deep it goes
Explains immutability, structural sharing, and version movement, while deferring structural-sharing mechanics to a later explanation.
Examples
Uses Data V12 and Data V13 after mutations B and C to illustrate reference movement between versions.
What you can do after
Apply the pattern by keeping mutation calculations immutable and committing their returned version through one mutable reference.
How it connects
Connects immutable data, structural sharing, mutations, state history, garbage collection, and time-travel restoration.

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.