Part IX: the whole journey and the sentences to remember; forbidden words removed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
MatsuneMikuroiandClaude Opus 5.5 committed 2026-10-16 09:12:32 +02:00
1 parent 45dd65b48e
commit 01f681165f
4 files changed
+111 -8

No files matched your search

+2 -2
View File
@@ -7,7 +7,7 @@ Steps 28 to 34 go back to one JVM on purpose. With no replication delay and no f
:::
::: {.fr}
Les étapes 28 à 34 reviennent volontairement à une seule JVM. Sans délai de réplication ni cinq terminaux, la seule chose qui peut changer est qui connaît qui — l'idée s'essaie donc en quelques secondes plutôt qu'au cours d'une séance de débogage distribué.
Les étapes 28 à 34 reviennent volontairement à une seule JVM. Sans délai de réplication ni cinq terminaux, la seule chose qui peut changer est qui connaît qui — l'idée s'essaie donc en quelques secondes plutôt que pendant une séance de débogage distribué.
:::
::: {.de}
@@ -124,7 +124,7 @@ Eine Beobachtung aus dem Lauf: nach `Ctrl+D` endet die Ausgabe, das Programm ble
::: {.en}
Apply two tests to `TOPIC consoleIn.outbox`. Does it describe something that happened? No. Something currently true? No. It says *please begin listening here* — desired behaviour, which is **Intent**. The mediator's `ROUTE` is the same kind of message: *please forward from here to there*.
One trap worth naming, because it is tempting in a defence: *publishing* an Intent is of course something that happened. Classification follows what the message says, not the fact that it exists.
One trap worth naming, because it is tempting in a defence: *publishing* an Intent is naturally something that happened. Classification follows what the message says, not the fact that it exists.
And one condition, which returns later: the dynamic version is **not** automatically superior. It makes sense only if the consumer actually understands the producer's message contract.
+2 -2
View File
@@ -110,7 +110,7 @@ Run `SensorService`, `DynamicProcessorService` and `DynamicActuatorService` —
`consoleOut/inbox` holds **no payload at all**: ConsoleOut takes straight from `rot13/outbox`. Its inbox changed job, from carrying messages to carrying wiring.
A line typed *before* `Configure.java` ran stays in `consoleIn/outbox` forever. A subscription that does not exist yet misses what came before it — the same lesson as the mediator that was restarted and delivered nothing.
A line typed *before* `Configure.java` ran stays in `consoleIn/outbox` forever. A subscription that does not exist yet misses what came before it — exactly what the restarted mediator showed when it delivered nothing.
| version | application publications | processes in the data path |
|---|---|---|
@@ -131,7 +131,7 @@ Lancez `SensorService`, `DynamicProcessorService` et `DynamicActuatorService`
`consoleOut/inbox` ne contient **aucune charge utile** : ConsoleOut retire directement de `rot13/outbox`. Sa boîte a changé de métier, des messages vers le câblage.
Une ligne tapée *avant* l'exécution de `Configure.java` reste dans `consoleIn/outbox` pour toujours. Un abonnement qui n'existe pas encore manque ce qui l'a précédé — la même leçon que le médiateur redémarré qui n'a rien livré.
Une ligne tapée *avant* l'exécution de `Configure.java` reste dans `consoleIn/outbox` pour toujours. Un abonnement qui n'existe pas encore manque ce qui l'a précédé — le même constat que le médiateur redémarré qui n'a rien livré.
| version | publications applicatives | processus dans le chemin des données |
|---|---|---|
+1 -1
View File
@@ -88,7 +88,7 @@ Three kinds of message, named only after being used:
Past tense is a useful hint for Events. For Intent the test is two questions: does the message report something that happened? No. Something currently true? No. Then it requests behaviour.
One trap: *publishing* an Intent is of course something that happened. Classify by what the message says, not by the fact that it exists — otherwise every message becomes an Event and the vocabulary stops being useful.
One trap: *publishing* an Intent is naturally something that happened. Classify by what the message says, not by the fact that it exists — otherwise every message becomes an Event and the vocabulary stops being useful.
Status deserves its own note, because the instinct is to **ask** for it: "what are your subscriptions?" But asking is a call, and a call needs the asker to know the component, to know it is up, and to wait. Status is **published**: ROT13 publishes `ROT13/S/subscriptions` whenever its wiring changes, and anyone interested reads it. The reader then needs a topic, not a component, and ROT13 never learns who audits it. Each kind answers a different question:
+106 -3
View File
@@ -53,7 +53,7 @@ Ein repliziertes Dateisystem gibt zudem jeder Maschine eine lokale Kopie, eine e
The reaction the material is after: *"Oh. We already know this architecture."* MQTT is a transport change, not an architectural claim.
Two things a directory could not do, both visible in a minute at the command line. A publication made **before** a subscriber exists never reaches it — the stranded-message lesson for the third time, now with an answer the filesystem never had. And a filter like `test/#` matches `test/a` and `test/a/b/c` but not `testing/x`, because `#` works on **levels**, not string prefixes; `test/+` would match only one level down.
Two things a directory could not do, both visible in a minute at the command line. A publication made **before** a subscriber exists never reaches it — the stranded-message problem for the third time, now with an answer the filesystem never had. And a filter like `test/#` matches `test/a` and `test/a/b/c` but not `testing/x`, because `#` works on **levels**, not string prefixes; `test/+` would match only one level down.
The deeper correction: **a topic is not a container.** There is no object called `test/a` on the broker. A topic is a routing key carried by each publication and matched against the filters of whoever is subscribed at that instant. Directories *hold* messages; topics *match* them. One subscription therefore covers topics that do not exist yet — where a message board needed a new directory and a new registration.
:::
@@ -73,7 +73,7 @@ The deeper correction: **a topic is not a container.** There is no object called
La réaction visée par le matériel : « Ah. Nous connaissons déjà cette architecture. » MQTT est un changement de transport, pas une affirmation architecturale.
Deux choses qu'un répertoire ne pouvait pas faire, visibles en une minute en ligne de commande. Une publication faite **avant** l'existence d'un abonné ne lui parvient jamais — la leçon des messages bloqués, pour la troisième fois, mais avec une réponse que le système de fichiers n'avait pas. Et un filtre comme `test/#` correspond à `test/a` et `test/a/b/c` mais pas à `testing/x`, car `#` travaille par **niveaux** et non par préfixes de chaîne ; `test/+` ne correspondrait qu'à un seul niveau.
Deux choses qu'un répertoire ne pouvait pas faire, visibles en une minute en ligne de commande. Une publication faite **avant** l'existence d'un abonné ne lui parvient jamais — le constat des messages bloqués, pour la troisième fois, mais avec une réponse que le système de fichiers n'avait pas. Et un filtre comme `test/#` correspond à `test/a` et `test/a/b/c` mais pas à `testing/x`, car `#` travaille par **niveaux** et non par préfixes de chaîne ; `test/+` ne correspondrait qu'à un seul niveau.
La correction plus profonde : **un sujet n'est pas un conteneur.** Il n'existe aucun objet nommé `test/a` sur le courtier. Un sujet est une clé de routage portée par chaque publication et confrontée aux filtres de qui est abonné à cet instant. Les répertoires *contiennent* les messages ; les sujets les *filtrent*. Un seul abonnement couvre donc des sujets qui n'existent pas encore — là où un tableau de messages exigeait un nouveau répertoire et un nouvel enregistrement.
:::
@@ -161,7 +161,7 @@ subscribe:
C'est seulement là qu'une bibliothèque de sérialisation a une tâche claire. `JsonTools` garde **deux** mappeurs, et l'asymétrie est voulue :
- la lecture utilise une fabrique **YAML** avec `FAIL_ON_UNKNOWN_PROPERTIES` désactivé — JSON étant un sous-ensemble de YAML, un Intent tapé à la main est accepté, et un configurateur plus récent peut envoyer des champs qu'un service plus ancien ignore ;
- en entrée, une fabrique **YAML** avec `FAIL_ON_UNKNOWN_PROPERTIES` désactivé — JSON étant un sous-ensemble de YAML, un Intent tapé à la main est accepté, et un configurateur plus récent peut envoyer des champs qu'un service plus ancien ignore ;
- l'écriture utilise du **JSON** strict avec `INDENT_OUTPUT` activé, donc les charges publiées sont strictes et lisibles.
Tolérant en entrée, strict en sortie. Un mappeur unique devrait renoncer à l'un des deux.
@@ -359,3 +359,106 @@ Die Prüfliste aus Schritt 78 ist das Werkzeug, das bleibt. Zwölf Fragen, von d
Die Mahnung des Materials gilt: die Antworten müssen nicht alle „nein" lauten. Sie müssen **absichtlich** sein.
:::
## [The whole journey]{.en}[Le parcours complet]{.fr}[Der ganze Weg]{.de} {#sec-whole-journey}
::: {.en}
The program never changed: a line goes in, the same line comes out rotated by 13 letters. What changed, eleven times, is how the parts are joined and who holds the knowledge of how they are joined.
| stage | how the parts are joined | where the topology lives | in the data path besides the capabilities |
|---|---|---|---|
| 1 procedural | direct calls | inside the capability code | — |
| 2 egoistic services | not joined at all | nowhere — that is the problem | — |
| 3 static mediation, one JVM | mailboxes, copied by mediators | the mediators, started in `main()` | two mediators |
| 4 static mediation, filesystem | directories, copied by mediator processes | the operator's command lines | two mediator processes |
| 5 static mediation, Syncthing | replicated directories | the operator's command lines | two mediator processes, plus replication delay |
| 6 named, configurable mediators | `ROUTE` Intent from an orchestrator | the orchestrator, outside the path | the mediators, still |
| 7 dynamic, one JVM | services listen, told by `TOPIC` Intent | the configurator | nothing |
| 8 dynamic, filesystem | the same, over directories | the configurator | nothing |
| 9 dynamic, Syncthing | the same, over replicated directories | the configurator | nothing — transport hops only |
| 10 contracts | compatible: direct; incompatible: a transformer | the configurator | a transformer, only where contracts differ |
| 11 MQTT | topics on a broker | the configurator | nothing — the broker is transport |
Read the third column from top to bottom: the topology moves outward, one stage at a time, until no capability holds any of it. Read the last one: the price of that move falls to zero at stage 7 and stays there while the transport changes underneath three times. Same architecture, better transport.
:::
::: {.fr}
Le programme n'a jamais changé : une ligne entre, la même ressort décalée de 13 lettres. Ce qui a changé, onze fois, c'est la manière dont les parties sont reliées et qui détient la connaissance de ce câblage.
| étape | comment les parties sont reliées | où vit la topologie | dans le chemin des données, outre les capacités |
|---|---|---|---|
| 1 procédural | appels directs | dans le code de la capacité | — |
| 2 services égoïstes | pas reliées du tout | nulle part — c'est le problème | — |
| 3 médiation statique, une JVM | boîtes, copiées par des médiateurs | les médiateurs, démarrés dans `main()` | deux médiateurs |
| 4 médiation statique, système de fichiers | répertoires, copiés par des processus médiateurs | les lignes de commande de l'opérateur | deux processus médiateurs |
| 5 médiation statique, Syncthing | répertoires répliqués | les lignes de commande de l'opérateur | deux processus médiateurs, plus le délai de réplication |
| 6 médiateurs nommés et configurables | Intent `ROUTE` d'un orchestrateur | l'orchestrateur, hors du chemin | les médiateurs, encore |
| 7 dynamique, une JVM | les services écoutent, guidés par un Intent `TOPIC` | le configurateur | rien |
| 8 dynamique, système de fichiers | idem, sur des répertoires | le configurateur | rien |
| 9 dynamique, Syncthing | idem, sur des répertoires répliqués | le configurateur | rien — seulement des sauts de transport |
| 10 contrats | compatibles : direct ; incompatibles : un transformateur | le configurateur | un transformateur, seulement là où les contrats diffèrent |
| 11 MQTT | des sujets sur un courtier | le configurateur | rien — le courtier est du transport |
Lisez la troisième colonne de haut en bas : la topologie s'éloigne, une étape après l'autre, jusqu'à ce qu'aucune capacité n'en détienne plus rien. Lisez la dernière : le prix de ce déplacement tombe à zéro à l'étape 7 et y reste pendant que le transport change trois fois en dessous. Même architecture, meilleur transport.
:::
::: {.de}
Das Programm hat sich nie geändert: eine Zeile geht hinein, dieselbe kommt um 13 Buchstaben verschoben heraus. Geändert hat sich, elfmal, wie die Teile verbunden sind und wer das Wissen über diese Verbindung hält.
| Stufe | wie die Teile verbunden sind | wo die Topologie liegt | im Datenpfad ausser den Fähigkeiten |
|---|---|---|---|
| 1 prozedural | direkte Aufrufe | im Code der Fähigkeit | — |
| 2 egoistische Dienste | gar nicht verbunden | nirgends — das ist das Problem | — |
| 3 statische Vermittlung, eine JVM | Postfächer, von Vermittlern kopiert | die Vermittler, gestartet in `main()` | zwei Vermittler |
| 4 statische Vermittlung, Dateisystem | Verzeichnisse, von Vermittlerprozessen kopiert | die Befehlszeilen des Bedieners | zwei Vermittlerprozesse |
| 5 statische Vermittlung, Syncthing | replizierte Verzeichnisse | die Befehlszeilen des Bedieners | zwei Vermittlerprozesse, dazu Replikationsverzögerung |
| 6 benannte, konfigurierbare Vermittler | `ROUTE`-Intent von einem Orchestrator | der Orchestrator, ausserhalb des Pfads | weiterhin die Vermittler |
| 7 dynamisch, eine JVM | die Dienste hören selbst, gesteuert durch `TOPIC`-Intent | der Konfigurator | nichts |
| 8 dynamisch, Dateisystem | dasselbe, über Verzeichnisse | der Konfigurator | nichts |
| 9 dynamisch, Syncthing | dasselbe, über replizierte Verzeichnisse | der Konfigurator | nichts — nur Transportsprünge |
| 10 Verträge | kompatibel: direkt; inkompatibel: ein Transformator | der Konfigurator | ein Transformator, nur wo Verträge sich unterscheiden |
| 11 MQTT | Topics auf einem Broker | der Konfigurator | nichts — der Broker ist Transport |
Die dritte Spalte von oben nach unten gelesen: die Topologie wandert nach aussen, Stufe um Stufe, bis keine Fähigkeit mehr etwas davon hält. Die letzte gelesen: der Preis dieser Wanderung fällt in Stufe 7 auf null und bleibt dort, während darunter dreimal der Transport wechselt. Dieselbe Architektur, besserer Transport.
:::
## [The sentences to remember]{.en}[Les phrases à retenir]{.fr}[Die Sätze, die man behalten sollte]{.de} {#sec-sentences}
::: {.en}
- **Event-driven describes how information and control flow.**
- **Loose coupling describes how much participants need to know about one another.**
- **Publish what happened.**
- **Declare what you want.**
- **Publish your own State.**
- **Keep capabilities egoistic.**
- **Keep topology out of capabilities.**
- **Do not pay for a mediator unless it actually mediates something.**
And whenever an architecture becomes confusing, go back to the first question of this book: **who knows whom?**
:::
::: {.fr}
- **« Event-driven » décrit comment circulent l'information et le contrôle.**
- **Le couplage faible décrit ce que les participants doivent savoir les uns des autres.**
- **Publiez ce qui est arrivé.**
- **Déclarez ce que vous voulez.**
- **Publiez votre propre état.**
- **Gardez les capacités égoïstes.**
- **Gardez la topologie hors des capacités.**
- **Ne payez pas un médiateur qui ne fait pas réellement de médiation.**
Et chaque fois qu'une architecture devient confuse, revenez à la première question de ce livre : **qui connaît qui ?**
:::
::: {.de}
- **„Event-driven" beschreibt, wie Information und Steuerung fliessen.**
- **Lose Kopplung beschreibt, wie viel die Beteiligten voneinander wissen müssen.**
- **Veröffentliche, was geschehen ist.**
- **Erkläre, was du willst.**
- **Veröffentliche deinen eigenen Zustand.**
- **Halte Fähigkeiten egoistisch.**
- **Halte die Topologie aus den Fähigkeiten heraus.**
- **Bezahle keinen Vermittler, der nicht wirklich vermittelt.**
Und wann immer eine Architektur verwirrend wird, zurück zur ersten Frage dieses Buches: **wer kennt wen?**
:::