Remote / An event-sourced domain behind Remote
Who owns what
| Fact or transition | Owner |
|---|---|
| The Events, and whether a Command is accepted | the Aggregate's decide and evolve |
| The row a reader sees, and whether they may see it | the View, and its validate |
| A lowered write's precondition, guard and invariants | the declaration (Write, Guards, Entity.invariant) |
| A hand-written Command's rules | the Aggregate's own decide |
| The page's copy of a row, a pending write and its prediction, a refusal | Remote (Remote.Model) |
| The receipt of a write whose View is behind, and each row's revision | Remote, as a read-after token and a row revision |
| Translating between the two | the adapter (DomainRemote.layer), which owns no row and decides nothing |
A receipt is what a Command answers besides its reply: the stream it appended to and how many Events that stream now holds. A revision is a number field of the row that every Event of the stream moves; you name it when you bind the View, and Remote orders two copies of a row by it. "Receipt", "Command", "Aggregate", "Event", "View", "Rejection", "Story" and "Api" are Domain's words; "Entity", "declared write", "guard", "invariant", "Refusal" and "prediction" are Foldkit Plus's.