Browse Source

Axxord blackboard API docs.

Herbert Vojčík 6 years ago
parent
commit
03b9966dd3
1 changed files with 35 additions and 0 deletions
  1. 35 0
      README.md

+ 35 - 0
README.md

@@ -105,3 +105,38 @@ Syntactic sugar: as `(foo)` happens often, to denote unary selector,
 it can be written equivalently as `~foo`, to improve readability.
 So above Axes' parseable string representation
 would likely be written `'~value'` and `'~todos 1 done'` instead.
+
+Axxord
+----
+
+Axxord is a blackboard-like system using `Axon` and friends to observe
+the object of interest, using axes as an aspect, and coming with a few helpers
+included.
+
+You create the model you want to observe as plain Smalltalk object
+(wrapped JavaScript object should work, too). Then create an axon:
+`axon := SimpleAxon new` and assign it to the object of interest:
+`model axxord: axon`.
+
+The clients of the model should access it via the axxord extension methods
+`axes:consume:` and `axes:transform:`. To read an aspect and enact on
+the result, use `model axes: #((value)) consume: [:counter | ...]`; to change
+the aspect, use `model axes: #((todos) 1 done) transform: [:done | done not]`.
+The latter automatically informs the axon after the change is made.
+
+There are convenience methods to create the axes-related interests.
+To create an interest on an aspect only, but not its sub-contents,
+use `Axes newInterestUpTo: #(left (amount)) doing: [...]`. This would react to
+`axon changed: #(left)` as well as `axon changed: #(left (amount))`,
+but not to `axon changed :#(left (amount) (description))`. On the contrary,
+an interest created by `Axes newInterestThru: #(left (amount)) doing: [...]`
+would react to `axon changed :#(left (amount) (description))` as well,
+but none of them would react to unrelated `axon changed: #(left (name))`;
+as shown in the following table
+
+| `axon changed:` | `newInterestUpTo: #(left (amount))` | `newInterestThru: #(left (amount))` |
+|--------|--------|----------|
+| `#(left)` | enacts | enacts |
+| `#(left (amount))` | enacts | enacts |
+| `#(left (amount) (desc))` | passes | enacts |
+| `#(left (name))` | passes | passes |