14.2. State Change
A computation in Perspectives proceeds in part by changing state (the other part is: consulting state). State changes in two ways:
-
by creating Context and Role instances (always attaching the latter to the former)
-
and by changing them.
Changes are limited to:
-
adding role instances to contexts, or removing them
-
binding or unbinding roles;
-
changing property values.
State is saved in Couchdb. State is also partly saved in memory: this we call the cache.
Because multiple users have access to the same contexts, roles and property values (though two users never share exactly the same contexts and roles), changes must be synchronised.
In this text we document the relation between changing state and caching, saving and syncing that state change.