Rename book to Process Control

This commit is contained in:
MatsuneMikuroi committed 2026-09-29 12:34:56 +02:00
1 parent 919e79eb2a
commit afb816f459
53 files changed
+5584 -500

No files matched your search

+64 -20
View File
@@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>1&nbsp; Step 0 — What the tutorial is about – From Calling to Eventing</title>
<title>1&nbsp; Step 0 — What this is about – Process Control</title>
<style>
/* Default styles provided by pandoc.
** See https://pandoc.org/MANUAL.html#variables-for-html for config info.
@@ -52,9 +52,13 @@ ul.task-list li input[type="checkbox"] {
<link href="site_libs/quarto-contrib/calc-exo-2.0.0/exo.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-quiz-1.0.0/quiz.js"></script>
<link href="site_libs/quarto-contrib/calc-quiz-1.0.0/quiz.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-further-1.0.0/further.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-latex-tables-1.0.0/latex-tables.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-notes-1.0.0/calc-notes.js"></script>
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/theme.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/high-contrast.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/calc-notes.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/narrow.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-glossary-2.0.0/glossary.js"></script>
<link href="site_libs/quarto-contrib/calc-glossary-2.0.0/glossary.css" rel="stylesheet">
<script id="quarto-search-options" type="application/json">{
@@ -97,7 +101,7 @@ ul.task-list li input[type="checkbox"] {
nothing is attached to the links themselves: one capture-phase listener on
the document reads the link's final address at click time.
If a language has not been built (./render-all.sh), its pages do not exist:
If a language has not been built, its pages do not exist:
the target is checked first and a short note is shown instead of a
"Not Found" page.
@@ -113,12 +117,9 @@ ul.task-list li input[type="checkbox"] {
var ROOT_LANG = 'en'; // the language at the top of _book/
var COOKIE = 'notes-lang';
var NOTE = {
de: 'Diese Sprache wurde noch nicht erstellt. Einmal ./render-all.sh ausführen – '
+ 'danach funktioniert der Wechsel auch in der Vorschau.',
fr: 'Cette langue n’a pas encore été générée. Lancez une fois ./render-all.sh : '
+ 'ensuite le changement fonctionne aussi dans l’aperçu.',
en: 'This language hasn’t been built yet. Run ./render-all.sh once, '
+ 'then switching works in the preview too.'
de: 'Diese Sprache ist hier noch nicht verfügbar.',
fr: 'Cette langue n’est pas encore disponible ici.',
en: 'This language is not available here yet.'
};
var here = (document.documentElement.lang || ROOT_LANG).slice(0, 2);
@@ -132,9 +133,20 @@ ul.task-list li input[type="checkbox"] {
var m = document.cookie.match(/(?:^|;\s*)notes-lang=(de|fr|en)(?:;|$)/);
return m ? m[1] : null;
}
// path '/' on purpose: every book of these notes is served from one host,
// each under its own folder, so a language picked in any of them is the
// language all of them open in. A book hosted on its own would be no worse
// off -- the cookie simply has nothing else to reach.
var COOKIE_PATH = '/';
function remember(code) {
document.cookie = COOKIE + '=' + code + '; path=' + root + '; max-age=31536000; SameSite=Lax'
document.cookie = COOKIE + '=' + code + '; path=' + COOKIE_PATH
+ '; max-age=31536000; SameSite=Lax'
+ (location.protocol === 'https:' ? '; Secure' : '');
// a copy written under the book's own path by an earlier version would be
// the more specific one and would shadow the shared cookie for good
if (root !== COOKIE_PATH) {
document.cookie = COOKIE + '=; path=' + root + '; max-age=0';
}
}
// a returning reader lands in the language picked last time
@@ -156,7 +168,11 @@ ul.task-list li input[type="checkbox"] {
box.style.cssText = 'position:fixed;left:50%;bottom:1.25rem;transform:translateX(-50%);'
+ 'max-width:min(34rem,calc(100vw - 2rem));padding:.6rem .9rem;border-radius:6px;'
+ 'background:#1f2328;color:#fff;font-size:.85rem;line-height:1.4;z-index:2000;'
+ 'box-shadow:0 4px 16px rgba(0,0,0,.25)';
// a status message, so it keeps its own dark surface in either mode; the
// hairline is the page's rule colour, invisible on a light page and an
// edge against a dark one, where the shadow alone no longer separates it
+ 'border:1px solid var(--calc-line,#444);'
+ 'box-shadow:0 4px 16px var(--calc-shadow,rgba(0,0,0,.25))';
document.body.appendChild(box);
setTimeout(function () { box.remove(); }, 7000);
}
@@ -197,7 +213,35 @@ ul.task-list li input[type="checkbox"] {
}, true);
})();
</script>
<style>:root { --calc-notecolor: #B45309; }</style>
<style>:root {
--calc-furthercolor-src: #6B3FA0;
--calc-furthercolor: var(--calc-furthercolor-src);
}</style>
<style>:root {
--calc-notecolor-src: #B45309;
--calc-notecolor: var(--calc-notecolor-src);
}</style>
<script>(function (e) {
var KEY = 'notes-contrast', forced = false;
var picked = null;
try { picked = localStorage.getItem(KEY); } catch (err) {}
var q = null;
try { q = window.matchMedia && window.matchMedia('(prefers-contrast: more)'); } catch (err) {}
if (picked === 'more' || (picked !== 'normal' && (forced || (q && q.matches)))) {
e.classList.add('hc');
}
if (q) {
var f = function () {
var p = null;
try { p = localStorage.getItem(KEY); } catch (err) {}
if (p === null) e.classList.toggle('hc', forced || q.matches);
};
if (q.addEventListener) q.addEventListener('change', f);
else if (q.addListener) q.addListener(f);
}
})(document.documentElement);</script>
</head>
@@ -211,7 +255,7 @@ ul.task-list li input[type="checkbox"] {
<button type="button" class="quarto-btn-toggle btn" data-bs-toggle="collapse" role="button" data-bs-target=".quarto-sidebar-collapse-item" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
<i class="bi bi-layout-text-sidebar-reverse"></i>
</button>
<nav class="quarto-page-breadcrumbs" aria-label="breadcrumb"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="./00-orientation.html"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Step 0 — What the tutorial is about</span></a></li></ol></nav>
<nav class="quarto-page-breadcrumbs" aria-label="breadcrumb"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="./00-orientation.html"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Step 0 — What this is about</span></a></li></ol></nav>
<a class="flex-grow-1" role="navigation" data-bs-toggle="collapse" data-bs-target=".quarto-sidebar-collapse-item" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Toggle sidebar navigation" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
</a>
<button type="button" class="btn quarto-search-button" aria-label="Search" onclick="window.quartoOpenSearch();">
@@ -226,7 +270,7 @@ ul.task-list li input[type="checkbox"] {
<nav id="quarto-sidebar" class="sidebar collapse collapse-horizontal quarto-sidebar-collapse-item sidebar-navigation docked overflow-auto">
<div class="pt-lg-2 mt-2 text-left sidebar-header">
<div class="sidebar-title mb-0 py-0">
<a href="./">From Calling to Eventing</a>
<a href="./">Process Control</a>
<div class="sidebar-tools-main tools-wide">
<div class="dropdown">
<a href="" title="" id="quarto-navigation-tool-dropdown-0" class="quarto-navigation-tool dropdown-toggle px-1" data-bs-toggle="dropdown" aria-expanded="false" role="link" aria-label=""><i class="bi bi-translate"></i></a>
@@ -248,7 +292,7 @@ ul.task-list li input[type="checkbox"] {
</li>
</ul>
</div>
<a href="./From-Calling-to-Eventing.pdf" title="Download PDF" class="quarto-navigation-tool px-1" aria-label="Download PDF"><i class="bi bi-file-pdf"></i></a>
<a href="./Process-Control.pdf" title="Download PDF" class="quarto-navigation-tool px-1" aria-label="Download PDF"><i class="bi bi-file-pdf"></i></a>
<a href="" class="quarto-reader-toggle quarto-navigation-tool px-1" onclick="window.quartoToggleReader(); return false;" title="Toggle reader mode">
<div class="quarto-reader-toggle-btn">
<i class="bi"></i>
@@ -273,7 +317,7 @@ ul.task-list li input[type="checkbox"] {
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./00-orientation.html" class="sidebar-item-text sidebar-link active">
<span class="menu-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Step 0 — What the tutorial is about</span></span></a>
<span class="menu-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Step 0 — What this is about</span></span></a>
</div>
</li>
<li class="sidebar-item">
@@ -324,7 +368,7 @@ ul.task-list li input[type="checkbox"] {
<header id="title-block-header" class="quarto-title-block default">
<div class="quarto-title">
<h1 class="title"><span id="sec-step-0" class="quarto-section-identifier"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Step 0 — What the tutorial is about</span></span></h1>
<h1 class="title"><span id="sec-step-0" class="quarto-section-identifier"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Step 0 — What this is about</span></span></h1>
</div>
@@ -343,12 +387,12 @@ ul.task-list li input[type="checkbox"] {
<!-- MULTILINGUAL: see the comment at the top of index.qmd. -->
<p>Step 0 contains no code. It states the subject: not ROT13, but the architecture around it. The functionality stays almost unchanged for 81 steps, which is what makes the changes around it visible.</p>
<p>Two rules are set here and hold for the whole tutorial:</p>
<p>Two rules are set here and hold all the way through:</p>
<blockquote class="blockquote">
<p><strong>Meet each solution only after you have experienced the problem it solves.</strong></p>
</blockquote>
<p>That is why the tutorial does not start with MQTT, and not with dynamic subscriptions either. It first builds a system with deliberately awkward mediators, puts it into operation, and only then asks whether they have earned their place.</p>
<p>The second rule is about vocabulary: <em>Intent</em>, <em>Status/State</em> and <em>Event</em> are named only after they have been used. They appear in the tutorial around step 42, not before.</p>
<p>That is why the build-up does not start with MQTT, and not with dynamic subscriptions either. A system with deliberately awkward mediators is built first, put into operation, and only then asked whether those mediators have earned their place.</p>
<p>The second rule is about vocabulary: <em>Intent</em>, <em>Status/State</em> and <em>Event</em> are named only after they have been used. They appear around step 42, not before.</p>
<p>The planned route, from step 0:</p>
<pre class="text"><code>direct method calls → egoistic services → mediators → separate processes
→ filesystem as transport → Syncthing → "why all these mediators?" → rewind
@@ -364,7 +408,7 @@ ul.task-list li input[type="checkbox"] {
</colgroup>
<thead>
<tr class="header">
<th>The tutorial asks</th>
<th>As asked here</th>
<th>A weaker version</th>
</tr>
</thead>
+67 -23
View File
@@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>2&nbsp; Part I — Start with what you already know – From Calling to Eventing</title>
<title>2&nbsp; Part I — Start with what you already know – Process Control</title>
<style>
/* Default styles provided by pandoc.
** See https://pandoc.org/MANUAL.html#variables-for-html for config info.
@@ -87,9 +87,13 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<link href="site_libs/quarto-contrib/calc-exo-2.0.0/exo.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-quiz-1.0.0/quiz.js"></script>
<link href="site_libs/quarto-contrib/calc-quiz-1.0.0/quiz.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-further-1.0.0/further.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-latex-tables-1.0.0/latex-tables.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-notes-1.0.0/calc-notes.js"></script>
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/theme.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/high-contrast.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/calc-notes.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/narrow.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-glossary-2.0.0/glossary.js"></script>
<link href="site_libs/quarto-contrib/calc-glossary-2.0.0/glossary.css" rel="stylesheet">
<script id="quarto-search-options" type="application/json">{
@@ -132,7 +136,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
nothing is attached to the links themselves: one capture-phase listener on
the document reads the link's final address at click time.
If a language has not been built (./render-all.sh), its pages do not exist:
If a language has not been built, its pages do not exist:
the target is checked first and a short note is shown instead of a
"Not Found" page.
@@ -148,12 +152,9 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
var ROOT_LANG = 'en'; // the language at the top of _book/
var COOKIE = 'notes-lang';
var NOTE = {
de: 'Diese Sprache wurde noch nicht erstellt. Einmal ./render-all.sh ausführen – '
+ 'danach funktioniert der Wechsel auch in der Vorschau.',
fr: 'Cette langue n’a pas encore été générée. Lancez une fois ./render-all.sh : '
+ 'ensuite le changement fonctionne aussi dans l’aperçu.',
en: 'This language hasn’t been built yet. Run ./render-all.sh once, '
+ 'then switching works in the preview too.'
de: 'Diese Sprache ist hier noch nicht verfügbar.',
fr: 'Cette langue n’est pas encore disponible ici.',
en: 'This language is not available here yet.'
};
var here = (document.documentElement.lang || ROOT_LANG).slice(0, 2);
@@ -167,9 +168,20 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
var m = document.cookie.match(/(?:^|;\s*)notes-lang=(de|fr|en)(?:;|$)/);
return m ? m[1] : null;
}
// path '/' on purpose: every book of these notes is served from one host,
// each under its own folder, so a language picked in any of them is the
// language all of them open in. A book hosted on its own would be no worse
// off -- the cookie simply has nothing else to reach.
var COOKIE_PATH = '/';
function remember(code) {
document.cookie = COOKIE + '=' + code + '; path=' + root + '; max-age=31536000; SameSite=Lax'
document.cookie = COOKIE + '=' + code + '; path=' + COOKIE_PATH
+ '; max-age=31536000; SameSite=Lax'
+ (location.protocol === 'https:' ? '; Secure' : '');
// a copy written under the book's own path by an earlier version would be
// the more specific one and would shadow the shared cookie for good
if (root !== COOKIE_PATH) {
document.cookie = COOKIE + '=; path=' + root + '; max-age=0';
}
}
// a returning reader lands in the language picked last time
@@ -191,7 +203,11 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
box.style.cssText = 'position:fixed;left:50%;bottom:1.25rem;transform:translateX(-50%);'
+ 'max-width:min(34rem,calc(100vw - 2rem));padding:.6rem .9rem;border-radius:6px;'
+ 'background:#1f2328;color:#fff;font-size:.85rem;line-height:1.4;z-index:2000;'
+ 'box-shadow:0 4px 16px rgba(0,0,0,.25)';
// a status message, so it keeps its own dark surface in either mode; the
// hairline is the page's rule colour, invisible on a light page and an
// edge against a dark one, where the shadow alone no longer separates it
+ 'border:1px solid var(--calc-line,#444);'
+ 'box-shadow:0 4px 16px var(--calc-shadow,rgba(0,0,0,.25))';
document.body.appendChild(box);
setTimeout(function () { box.remove(); }, 7000);
}
@@ -232,7 +248,35 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
}, true);
})();
</script>
<style>:root { --calc-notecolor: #B45309; }</style>
<style>:root {
--calc-furthercolor-src: #6B3FA0;
--calc-furthercolor: var(--calc-furthercolor-src);
}</style>
<style>:root {
--calc-notecolor-src: #B45309;
--calc-notecolor: var(--calc-notecolor-src);
}</style>
<script>(function (e) {
var KEY = 'notes-contrast', forced = false;
var picked = null;
try { picked = localStorage.getItem(KEY); } catch (err) {}
var q = null;
try { q = window.matchMedia && window.matchMedia('(prefers-contrast: more)'); } catch (err) {}
if (picked === 'more' || (picked !== 'normal' && (forced || (q && q.matches)))) {
e.classList.add('hc');
}
if (q) {
var f = function () {
var p = null;
try { p = localStorage.getItem(KEY); } catch (err) {}
if (p === null) e.classList.toggle('hc', forced || q.matches);
};
if (q.addEventListener) q.addEventListener('change', f);
else if (q.addListener) q.addListener(f);
}
})(document.documentElement);</script>
</head>
@@ -261,7 +305,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<nav id="quarto-sidebar" class="sidebar collapse collapse-horizontal quarto-sidebar-collapse-item sidebar-navigation docked overflow-auto">
<div class="pt-lg-2 mt-2 text-left sidebar-header">
<div class="sidebar-title mb-0 py-0">
<a href="./">From Calling to Eventing</a>
<a href="./">Process Control</a>
<div class="sidebar-tools-main tools-wide">
<div class="dropdown">
<a href="" title="" id="quarto-navigation-tool-dropdown-0" class="quarto-navigation-tool dropdown-toggle px-1" data-bs-toggle="dropdown" aria-expanded="false" role="link" aria-label=""><i class="bi bi-translate"></i></a>
@@ -283,7 +327,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
</li>
</ul>
</div>
<a href="./From-Calling-to-Eventing.pdf" title="Download PDF" class="quarto-navigation-tool px-1" aria-label="Download PDF"><i class="bi bi-file-pdf"></i></a>
<a href="./Process-Control.pdf" title="Download PDF" class="quarto-navigation-tool px-1" aria-label="Download PDF"><i class="bi bi-file-pdf"></i></a>
<a href="" class="quarto-reader-toggle quarto-navigation-tool px-1" onclick="window.quartoToggleReader(); return false;" title="Toggle reader mode">
<div class="quarto-reader-toggle-btn">
<i class="bi"></i>
@@ -308,7 +352,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./00-orientation.html" class="sidebar-item-text sidebar-link">
<span class="menu-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Step 0 — What the tutorial is about</span></span></a>
<span class="menu-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Step 0 — What this is about</span></span></a>
</div>
</li>
<li class="sidebar-item">
@@ -417,7 +461,7 @@ Figure&nbsp;2.1: The procedural version. The wiring is written into the code: <c
<section id="sec-step-2" class="level2" data-number="2.2">
<h2 data-number="2.2" class="anchored" data-anchor-id="sec-step-2"><span class="header-section-number">2.2</span> Step 2 — Three egoistic capabilities</h2>
<p>An <strong>egoistic</strong> component says: I know what I can do, what data I accept and what data I produce — and I would rather not know the business process around me. Concretely, <code>ConsoleIn</code> must not contain <code>rot13(...)</code>, and <code>ROT13</code> must not contain <code>consoleOut(...)</code>.</p>
<p>Removing those calls immediately creates a problem, which the tutorial states as a question: if nobody knows anybody, <strong>who makes this into a system?</strong> Note what the question does <em>not</em> say: the knowledge is not gone, it has to go somewhere else. Two connections are missing, not one — <code>ConsoleIn ↔︎ ROT13</code> and <code>ROT13 ↔︎ ConsoleOut</code>.</p>
<p>Removing those calls immediately creates a problem, best put as a question: if nobody knows anybody, <strong>who makes this into a system?</strong> Note what the question does <em>not</em> say: the knowledge is not gone, it has to go somewhere else. Two connections are missing, not one — <code>ConsoleIn ↔︎ ROT13</code> and <code>ROT13 ↔︎ ConsoleOut</code>.</p>
</section>
<section id="sec-step-3" class="level2" data-number="2.3">
<h2 data-number="2.3" class="anchored" data-anchor-id="sec-step-3"><span class="header-section-number">2.3</span> Step 3 — Give every capability a mailbox</h2>
@@ -429,7 +473,7 @@ Figure&nbsp;2.1: The procedural version. The wiring is written into the code: <c
<span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a><span class="bu">BlockingQueue</span><span class="op">&lt;</span>Message<span class="op">&gt;</span> <span class="fu">mailbox</span><span class="op">(</span><span class="bu">String</span> name<span class="op">)</span> <span class="op">{</span></span>
<span id="cb2-6"><a href="#cb2-6" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> mailboxes<span class="op">.</span><span class="fu">computeIfAbsent</span><span class="op">(</span>name<span class="op">,</span> _ <span class="op">-&gt;</span> <span class="kw">new</span> <span class="bu">LinkedBlockingQueue</span><span class="op">&lt;&gt;());</span></span>
<span id="cb2-7"><a href="#cb2-7" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></div>
<p>The tutorial insists on calling these <strong>mailboxes</strong>, not topics, and gives the reason: if two readers call <code>take()</code> on the same mailbox, they compete — each message goes to exactly <em>one</em> of them and is not copied to both. A topic, in Publish/Subscribe, would hand every subscriber its own copy. One reader per message is enough for now, and the limitation is kept on purpose: it is what makes it clear later what Publish/Subscribe actually adds.</p>
<p>These are <strong>mailboxes</strong>, not topics, and the distinction is worth insisting on: if two readers call <code>take()</code> on the same mailbox, they compete — each message goes to exactly <em>one</em> of them and is not copied to both. A topic, in Publish/Subscribe, would hand every subscriber its own copy. One reader per message is enough for now, and the limitation is kept on purpose: it is what makes it clear later what Publish/Subscribe actually adds.</p>
</section>
<section id="sec-steps-4-6" class="level2" data-number="2.4">
<h2 data-number="2.4" class="anchored" data-anchor-id="sec-steps-4-6"><span class="header-section-number">2.4</span> Steps 4–6 — The three capabilities become egoistic</h2>
@@ -460,7 +504,7 @@ Figure&nbsp;2.1: The procedural version. The wiring is written into the code: <c
</tr>
</tbody>
</table>
<p>No capability contains the name of another. The tutorial’s own summary of the result: “three nicely isolated capabilities. And they do absolutely nothing together.” Nothing moves a message from <code>consoleIn.outbox</code> to <code>rot13.inbox</code>, or from <code>rot13.outbox</code> to <code>consoleOut.inbox</code>.</p>
<p>No capability contains the name of another, and that is exactly the result: three nicely isolated capabilities that do absolutely nothing together. Nothing moves a message from <code>consoleIn.outbox</code> to <code>rot13.inbox</code>, or from <code>rot13.outbox</code> to <code>consoleOut.inbox</code>.</p>
</section>
<section id="sec-step-7" class="level2" data-number="2.5">
<h2 data-number="2.5" class="anchored" data-anchor-id="sec-step-7"><span class="header-section-number">2.5</span> Step 7 — Enter the mediator</h2>
@@ -485,7 +529,7 @@ Figure&nbsp;2.2: The mediated version inside one JVM. In the web version, <stron
<section id="sec-step-8" class="level2" data-number="2.6">
<h2 data-number="2.6" class="anchored" data-anchor-id="sec-step-8"><span class="header-section-number">2.6</span> Step 8 — Ask again: who knows whom?</h2>
<p>Does ConsoleIn know ROT13? No.&nbsp;Does ROT13 know ConsoleIn or ConsoleOut? No.&nbsp;Has the topology disappeared? No — it sits in the two <code>mediate(...)</code> calls inside <code>main()</code>.</p>
<p>This is the tutorial’s first major result:</p>
<p>This is the first major result:</p>
<blockquote class="blockquote">
<p><strong>Decoupling often does not make knowledge disappear. It moves knowledge to where it belongs.</strong></p>
</blockquote>
@@ -494,7 +538,7 @@ Figure&nbsp;2.2: The mediated version inside one JVM. In the web version, <stron
<section id="sec-step-9" class="level2" data-number="2.7">
<h2 data-number="2.7" class="anchored" data-anchor-id="sec-step-9"><span class="header-section-number">2.7</span> Step 9 — Why virtual threads?</h2>
<p>Five loops now wait indefinitely: the keyboard, <code>rot13.inbox</code>, <code>consoleOut.inbox</code> and the two mediators’ sources. Virtual threads are simply the cheap Java way to let five waits happen at once inside one JVM.</p>
<p>They are an implementation convenience, not an architecture. The architecture — who knows whom, and where the wiring lives — is in the mailbox names, not in the threads. The tutorial’s own evidence for the separation: the same architecture will run as separate processes in step 11, with no threads shared between the parts.</p>
<p>They are an implementation convenience, not an architecture. The architecture — who knows whom, and where the wiring lives — is in the mailbox names, not in the threads. The evidence for the separation: the same architecture will run as separate processes in step 11, with no threads shared between the parts.</p>
</section>
<section id="sec-step-10" class="level2" data-number="2.8">
<h2 data-number="2.8" class="anchored" data-anchor-id="sec-step-10"><span class="header-section-number">2.8</span> Step 10 — Keep the services egoistic</h2>
@@ -521,7 +565,7 @@ Figure&nbsp;2.2: The mediated version inside one JVM. In the web version, <stron
</tr>
</tbody>
</table>
<p>The tutorial is honest about the price: this design “may look indirect — even a little odd”, and it promises a different way to keep services egoistic <em>without</em> a mediator in every message’s path.</p>
<p>The price is worth stating plainly: this design may look indirect — even a little odd. There is another way to keep services egoistic <em>without</em> a mediator in every message’s path, and it comes later.</p>
</section>
<section id="sec-part-i-result" class="level2" data-number="2.9">
<h2 data-number="2.9" class="anchored" data-anchor-id="sec-part-i-result"><span class="header-section-number">2.9</span> What part I moved</h2>
@@ -551,7 +595,7 @@ Figure&nbsp;2.2: The mediated version inside one JVM. In the web version, <stron
</tr>
</tbody>
</table>
<p>Functionality: unchanged. Lines of code: more. Parts that know each other: none. That is the trade the rest of the tutorial keeps testing.</p>
<p>Functionality: unchanged. Lines of code: more. Parts that know each other: none. That is the trade everything that follows keeps testing.</p>
</section>
@@ -1178,8 +1222,8 @@ Figure&nbsp;2.2: The mediated version inside one JVM. In the web version, <stron
</script>
<nav class="page-navigation">
<div class="nav-page nav-page-previous">
<a href="./00-orientation.html" class="pagination-link" aria-label="[Step 0 — What the tutorial is about]{.en}[Étape 0 — De quoi parle le tutoriel]{.fr}[Schritt 0 — Worum es im Tutorial geht]{.de}">
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Step 0 — What the tutorial is about</span></span>
<a href="./00-orientation.html" class="pagination-link" aria-label="[Step 0 — What this is about]{.en}[Étape 0 — De quoi il s'agit]{.fr}[Schritt 0 — Worum es geht]{.de}">
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Step 0 — What this is about</span></span>
</a>
</div>
<div class="nav-page nav-page-next">
+63 -19
View File
@@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>3&nbsp; Part II — Cross the process boundary – From Calling to Eventing</title>
<title>3&nbsp; Part II — Cross the process boundary – Process Control</title>
<style>
/* Default styles provided by pandoc.
** See https://pandoc.org/MANUAL.html#variables-for-html for config info.
@@ -87,9 +87,13 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<link href="site_libs/quarto-contrib/calc-exo-2.0.0/exo.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-quiz-1.0.0/quiz.js"></script>
<link href="site_libs/quarto-contrib/calc-quiz-1.0.0/quiz.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-further-1.0.0/further.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-latex-tables-1.0.0/latex-tables.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-notes-1.0.0/calc-notes.js"></script>
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/theme.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/high-contrast.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/calc-notes.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/narrow.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-glossary-2.0.0/glossary.js"></script>
<link href="site_libs/quarto-contrib/calc-glossary-2.0.0/glossary.css" rel="stylesheet">
<script id="quarto-search-options" type="application/json">{
@@ -132,7 +136,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
nothing is attached to the links themselves: one capture-phase listener on
the document reads the link's final address at click time.
If a language has not been built (./render-all.sh), its pages do not exist:
If a language has not been built, its pages do not exist:
the target is checked first and a short note is shown instead of a
"Not Found" page.
@@ -148,12 +152,9 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
var ROOT_LANG = 'en'; // the language at the top of _book/
var COOKIE = 'notes-lang';
var NOTE = {
de: 'Diese Sprache wurde noch nicht erstellt. Einmal ./render-all.sh ausführen – '
+ 'danach funktioniert der Wechsel auch in der Vorschau.',
fr: 'Cette langue n’a pas encore été générée. Lancez une fois ./render-all.sh : '
+ 'ensuite le changement fonctionne aussi dans l’aperçu.',
en: 'This language hasn’t been built yet. Run ./render-all.sh once, '
+ 'then switching works in the preview too.'
de: 'Diese Sprache ist hier noch nicht verfügbar.',
fr: 'Cette langue n’est pas encore disponible ici.',
en: 'This language is not available here yet.'
};
var here = (document.documentElement.lang || ROOT_LANG).slice(0, 2);
@@ -167,9 +168,20 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
var m = document.cookie.match(/(?:^|;\s*)notes-lang=(de|fr|en)(?:;|$)/);
return m ? m[1] : null;
}
// path '/' on purpose: every book of these notes is served from one host,
// each under its own folder, so a language picked in any of them is the
// language all of them open in. A book hosted on its own would be no worse
// off -- the cookie simply has nothing else to reach.
var COOKIE_PATH = '/';
function remember(code) {
document.cookie = COOKIE + '=' + code + '; path=' + root + '; max-age=31536000; SameSite=Lax'
document.cookie = COOKIE + '=' + code + '; path=' + COOKIE_PATH
+ '; max-age=31536000; SameSite=Lax'
+ (location.protocol === 'https:' ? '; Secure' : '');
// a copy written under the book's own path by an earlier version would be
// the more specific one and would shadow the shared cookie for good
if (root !== COOKIE_PATH) {
document.cookie = COOKIE + '=; path=' + root + '; max-age=0';
}
}
// a returning reader lands in the language picked last time
@@ -191,7 +203,11 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
box.style.cssText = 'position:fixed;left:50%;bottom:1.25rem;transform:translateX(-50%);'
+ 'max-width:min(34rem,calc(100vw - 2rem));padding:.6rem .9rem;border-radius:6px;'
+ 'background:#1f2328;color:#fff;font-size:.85rem;line-height:1.4;z-index:2000;'
+ 'box-shadow:0 4px 16px rgba(0,0,0,.25)';
// a status message, so it keeps its own dark surface in either mode; the
// hairline is the page's rule colour, invisible on a light page and an
// edge against a dark one, where the shadow alone no longer separates it
+ 'border:1px solid var(--calc-line,#444);'
+ 'box-shadow:0 4px 16px var(--calc-shadow,rgba(0,0,0,.25))';
document.body.appendChild(box);
setTimeout(function () { box.remove(); }, 7000);
}
@@ -232,7 +248,35 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
}, true);
})();
</script>
<style>:root { --calc-notecolor: #B45309; }</style>
<style>:root {
--calc-furthercolor-src: #6B3FA0;
--calc-furthercolor: var(--calc-furthercolor-src);
}</style>
<style>:root {
--calc-notecolor-src: #B45309;
--calc-notecolor: var(--calc-notecolor-src);
}</style>
<script>(function (e) {
var KEY = 'notes-contrast', forced = false;
var picked = null;
try { picked = localStorage.getItem(KEY); } catch (err) {}
var q = null;
try { q = window.matchMedia && window.matchMedia('(prefers-contrast: more)'); } catch (err) {}
if (picked === 'more' || (picked !== 'normal' && (forced || (q && q.matches)))) {
e.classList.add('hc');
}
if (q) {
var f = function () {
var p = null;
try { p = localStorage.getItem(KEY); } catch (err) {}
if (p === null) e.classList.toggle('hc', forced || q.matches);
};
if (q.addEventListener) q.addEventListener('change', f);
else if (q.addListener) q.addListener(f);
}
})(document.documentElement);</script>
</head>
@@ -261,7 +305,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<nav id="quarto-sidebar" class="sidebar collapse collapse-horizontal quarto-sidebar-collapse-item sidebar-navigation docked overflow-auto">
<div class="pt-lg-2 mt-2 text-left sidebar-header">
<div class="sidebar-title mb-0 py-0">
<a href="./">From Calling to Eventing</a>
<a href="./">Process Control</a>
<div class="sidebar-tools-main tools-wide">
<div class="dropdown">
<a href="" title="" id="quarto-navigation-tool-dropdown-0" class="quarto-navigation-tool dropdown-toggle px-1" data-bs-toggle="dropdown" aria-expanded="false" role="link" aria-label=""><i class="bi bi-translate"></i></a>
@@ -283,7 +327,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
</li>
</ul>
</div>
<a href="./From-Calling-to-Eventing.pdf" title="Download PDF" class="quarto-navigation-tool px-1" aria-label="Download PDF"><i class="bi bi-file-pdf"></i></a>
<a href="./Process-Control.pdf" title="Download PDF" class="quarto-navigation-tool px-1" aria-label="Download PDF"><i class="bi bi-file-pdf"></i></a>
<a href="" class="quarto-reader-toggle quarto-navigation-tool px-1" onclick="window.quartoToggleReader(); return false;" title="Toggle reader mode">
<div class="quarto-reader-toggle-btn">
<i class="bi"></i>
@@ -308,7 +352,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./00-orientation.html" class="sidebar-item-text sidebar-link">
<span class="menu-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Step 0 — What the tutorial is about</span></span></a>
<span class="menu-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Step 0 — What this is about</span></span></a>
</div>
</li>
<li class="sidebar-item">
@@ -387,7 +431,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<section id="sec-step-11" class="level2" data-number="3.1">
<h2 data-number="3.1" class="anchored" data-anchor-id="sec-step-11"><span class="header-section-number">3.1</span> Step 11 — Separate the components</h2>
<p>Three processes cannot share a <code>BlockingQueue</code>: every <code>java</code> command starts its own JVM with its own memory, so the <code>mailboxes</code> map would exist three times and each copy would see only its own messages. An external transport is needed.</p>
<p>TCP would do, MQTT would do. The tutorial deliberately picks the most primitive option, the <strong>filesystem</strong>, and gives a one-line reason: <em>because you can see it</em>. Messages become files you can list with <code>ls</code> and read with <code>cat</code> while the system runs. Primitive here does not mean inferior; part VIII comes back to what the filesystem is genuinely good and bad at.</p>
<p>TCP would do, MQTT would do. The most primitive option is picked deliberately, the <strong>filesystem</strong>, for a one-line reason: <em>because you can see it</em>. Messages become files you can list with <code>ls</code> and read with <code>cat</code> while the system runs. Primitive here does not mean inferior; part VIII comes back to what the filesystem is genuinely good and bad at.</p>
</section>
<section id="sec-steps-12-13" class="level2" data-number="3.2">
<h2 data-number="3.2" class="anchored" data-anchor-id="sec-steps-12-13"><span class="header-section-number">3.2</span> Steps 12–13 — A directory becomes a mailbox</h2>
@@ -430,7 +474,7 @@ TIMESTAMP: 2026-09-22T10:42:12.123Z</code></pre>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb5"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="bu">printf</span> <span class="st">'TEXT\nHello from a file'</span> <span class="op">&gt;</span> messageBoard/consoleOut/inbox/manual.tmp</span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a><span class="fu">mv</span> messageBoard/consoleOut/inbox/manual.tmp messageBoard/consoleOut/inbox/manual.msg</span></code></pre></div><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></div>
<p><strong>Observed:</strong> nothing happens when the <code>.tmp</code> file appears; the line is printed the moment the rename creates the <code>.msg</code> name. Both accepted formats work, with and without the trailing timestamp.</p>
<p>The architectural lesson is the one the tutorial draws as <code>producer → filesystem → consumer</code>: the consumer could not tell a human typing <code>mv</code> from a real service. It knows its own inbox, not who writes into it. Egoism survived the process boundary.</p>
<p>The architectural point reads <code>producer → filesystem → consumer</code>: the consumer could not tell a human typing <code>mv</code> from a real service. It knows its own inbox, not who writes into it. Egoism survived the process boundary.</p>
</section>
<section id="sec-steps-16-17" class="level2" data-number="3.5">
<h2 data-number="3.5" class="anchored" data-anchor-id="sec-steps-16-17"><span class="header-section-number">3.5</span> Steps 16–17 — Services and mediator become processes</h2>
@@ -477,8 +521,8 @@ TIMESTAMP: 2026-09-22T10:42:12.123Z</code></pre>
</tr>
</tbody>
</table>
<p>The mediator is generic: its route is not compiled in, it arrives as two startup arguments. But the tutorial points at an asymmetry worth keeping in mind: the three capabilities receive their <strong>work</strong> as messages in a mailbox, while the mediator receives its <strong>route</strong> as startup configuration, and it has no name and no control mailbox of its own that anyone could write to.</p>
<p>The practical consequence: arguments are read once, so changing the route of a running mediator means stopping it and starting it again. A configuration file would be no different — it is still read at startup. The tutorial deliberately leaves this unfixed until the cost of the distributed mediators has been felt.</p>
<p>The mediator is generic: its route is not compiled in, it arrives as two startup arguments. But there is an asymmetry worth keeping in mind: the three capabilities receive their <strong>work</strong> as messages in a mailbox, while the mediator receives its <strong>route</strong> as startup configuration, and it has no name and no control mailbox of its own that anyone could write to.</p>
<p>The practical consequence: arguments are read once, so changing the route of a running mediator means stopping it and starting it again. A configuration file would be no different — it is still read at startup. This stays deliberately unfixed until the cost of the distributed mediators has been felt.</p>
</section>
<section id="sec-step-18" class="level2" data-number="3.6">
<h2 data-number="3.6" class="anchored" data-anchor-id="sec-step-18"><span class="header-section-number">3.6</span> Step 18 — Run the fully external local version</h2>
@@ -489,7 +533,7 @@ TIMESTAMP: 2026-09-22T10:42:12.123Z</code></pre>
<span id="cb6-4"><a href="#cb6-4" aria-hidden="true" tabindex="-1"></a><span class="ex">java</span> Mediator.java rot13/outbox consoleOut/inbox <span class="co"># terminal 4</span></span>
<span id="cb6-5"><a href="#cb6-5" aria-hidden="true" tabindex="-1"></a><span class="ex">java</span> ActuatorService.java <span class="co"># terminal 5</span></span></code></pre></div><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></div>
<p><strong>Observed:</strong> <code>Hello World</code> typed in terminal 1 appeared as <code>Uryyb Jbeyq</code> in terminal 5. The three middle terminals showed nothing new — each mediator prints one “Mediating: …” line at startup, and <code>ProcessorService</code> prints nothing at all. Afterwards each of the four mailbox directories held one <code>.msg</code> file: the same line, copied along the chain.</p>
<p>Count it: <strong>five processes</strong> for what step 1 did in one statement. The tutorial’s instruction at this point is not to optimise: “We are not done making it painful.”</p>
<p>Count it: <strong>five processes</strong> for what step 1 did in one statement. This is not the moment to optimise: it is not meant to be comfortable yet.</p>
<div id="fig-filesystem-processes" class="flow-figure quarto-float quarto-figure quarto-figure-center anchored">
<figure class="quarto-float quarto-float-fig figure">
<div aria-describedby="fig-filesystem-processes-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Binary file not shown.
Binary file not shown.
+82 -19
View File
@@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>1&nbsp; Schritt 0 — Worum es im Tutorial geht – Vom Aufruf zum Ereignis</title>
<title>1&nbsp; Schritt 0 — Worum es geht – Prozesssteuerung</title>
<style>
/* Default styles provided by pandoc.
** See https://pandoc.org/MANUAL.html#variables-for-html for config info.
@@ -50,9 +50,15 @@ ul.task-list li input[type="checkbox"] {
<link href="site_libs/bootstrap/bootstrap-cfe7114cbc4adb2af5ff3a891545d7fa.min.css" rel="stylesheet" append-hash="true" id="quarto-bootstrap" data-mode="light">
<script src="site_libs/quarto-contrib/calc-exo-2.0.0/exo.js"></script>
<link href="site_libs/quarto-contrib/calc-exo-2.0.0/exo.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-quiz-1.0.0/quiz.js"></script>
<link href="site_libs/quarto-contrib/calc-quiz-1.0.0/quiz.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-further-1.0.0/further.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-latex-tables-1.0.0/latex-tables.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-notes-1.0.0/calc-notes.js"></script>
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/theme.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/high-contrast.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/calc-notes.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/narrow.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-glossary-2.0.0/glossary.js"></script>
<link href="site_libs/quarto-contrib/calc-glossary-2.0.0/glossary.css" rel="stylesheet">
<script id="quarto-search-options" type="application/json">{
@@ -95,7 +101,7 @@ ul.task-list li input[type="checkbox"] {
nothing is attached to the links themselves: one capture-phase listener on
the document reads the link's final address at click time.
If a language has not been built (./render-all.sh), its pages do not exist:
If a language has not been built, its pages do not exist:
the target is checked first and a short note is shown instead of a
"Not Found" page.
@@ -111,12 +117,9 @@ ul.task-list li input[type="checkbox"] {
var ROOT_LANG = 'en'; // the language at the top of _book/
var COOKIE = 'notes-lang';
var NOTE = {
de: 'Diese Sprache wurde noch nicht erstellt. Einmal ./render-all.sh ausführen – '
+ 'danach funktioniert der Wechsel auch in der Vorschau.',
fr: 'Cette langue n’a pas encore été générée. Lancez une fois ./render-all.sh : '
+ 'ensuite le changement fonctionne aussi dans l’aperçu.',
en: 'This language hasn’t been built yet. Run ./render-all.sh once, '
+ 'then switching works in the preview too.'
de: 'Diese Sprache ist hier noch nicht verfügbar.',
fr: 'Cette langue n’est pas encore disponible ici.',
en: 'This language is not available here yet.'
};
var here = (document.documentElement.lang || ROOT_LANG).slice(0, 2);
@@ -130,9 +133,20 @@ ul.task-list li input[type="checkbox"] {
var m = document.cookie.match(/(?:^|;\s*)notes-lang=(de|fr|en)(?:;|$)/);
return m ? m[1] : null;
}
// path '/' on purpose: every book of these notes is served from one host,
// each under its own folder, so a language picked in any of them is the
// language all of them open in. A book hosted on its own would be no worse
// off -- the cookie simply has nothing else to reach.
var COOKIE_PATH = '/';
function remember(code) {
document.cookie = COOKIE + '=' + code + '; path=' + root + '; max-age=31536000; SameSite=Lax'
document.cookie = COOKIE + '=' + code + '; path=' + COOKIE_PATH
+ '; max-age=31536000; SameSite=Lax'
+ (location.protocol === 'https:' ? '; Secure' : '');
// a copy written under the book's own path by an earlier version would be
// the more specific one and would shadow the shared cookie for good
if (root !== COOKIE_PATH) {
document.cookie = COOKIE + '=; path=' + root + '; max-age=0';
}
}
// a returning reader lands in the language picked last time
@@ -154,7 +168,11 @@ ul.task-list li input[type="checkbox"] {
box.style.cssText = 'position:fixed;left:50%;bottom:1.25rem;transform:translateX(-50%);'
+ 'max-width:min(34rem,calc(100vw - 2rem));padding:.6rem .9rem;border-radius:6px;'
+ 'background:#1f2328;color:#fff;font-size:.85rem;line-height:1.4;z-index:2000;'
+ 'box-shadow:0 4px 16px rgba(0,0,0,.25)';
// a status message, so it keeps its own dark surface in either mode; the
// hairline is the page's rule colour, invisible on a light page and an
// edge against a dark one, where the shadow alone no longer separates it
+ 'border:1px solid var(--calc-line,#444);'
+ 'box-shadow:0 4px 16px var(--calc-shadow,rgba(0,0,0,.25))';
document.body.appendChild(box);
setTimeout(function () { box.remove(); }, 7000);
}
@@ -195,7 +213,35 @@ ul.task-list li input[type="checkbox"] {
}, true);
})();
</script>
<style>:root { --calc-notecolor: #B45309; }</style>
<style>:root {
--calc-furthercolor-src: #6B3FA0;
--calc-furthercolor: var(--calc-furthercolor-src);
}</style>
<style>:root {
--calc-notecolor-src: #B45309;
--calc-notecolor: var(--calc-notecolor-src);
}</style>
<script>(function (e) {
var KEY = 'notes-contrast', forced = false;
var picked = null;
try { picked = localStorage.getItem(KEY); } catch (err) {}
var q = null;
try { q = window.matchMedia && window.matchMedia('(prefers-contrast: more)'); } catch (err) {}
if (picked === 'more' || (picked !== 'normal' && (forced || (q && q.matches)))) {
e.classList.add('hc');
}
if (q) {
var f = function () {
var p = null;
try { p = localStorage.getItem(KEY); } catch (err) {}
if (p === null) e.classList.toggle('hc', forced || q.matches);
};
if (q.addEventListener) q.addEventListener('change', f);
else if (q.addListener) q.addListener(f);
}
})(document.documentElement);</script>
</head>
@@ -209,7 +255,7 @@ ul.task-list li input[type="checkbox"] {
<button type="button" class="quarto-btn-toggle btn" data-bs-toggle="collapse" role="button" data-bs-target=".quarto-sidebar-collapse-item" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Seitenleiste umschalten" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
<i class="bi bi-layout-text-sidebar-reverse"></i>
</button>
<nav class="quarto-page-breadcrumbs" aria-label="breadcrumb"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="./00-orientation.html"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Schritt 0 — Worum es im Tutorial geht</span></a></li></ol></nav>
<nav class="quarto-page-breadcrumbs" aria-label="breadcrumb"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="./00-orientation.html"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Schritt 0 — Worum es geht</span></a></li></ol></nav>
<a class="flex-grow-1" role="navigation" data-bs-toggle="collapse" data-bs-target=".quarto-sidebar-collapse-item" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Seitenleiste umschalten" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
</a>
<button type="button" class="btn quarto-search-button" aria-label="Suchen" onclick="window.quartoOpenSearch();">
@@ -224,7 +270,7 @@ ul.task-list li input[type="checkbox"] {
<nav id="quarto-sidebar" class="sidebar collapse collapse-horizontal quarto-sidebar-collapse-item sidebar-navigation docked overflow-auto">
<div class="pt-lg-2 mt-2 text-left sidebar-header">
<div class="sidebar-title mb-0 py-0">
<a href="./">Vom Aufruf zum Ereignis</a>
<a href="./">Prozesssteuerung</a>
<div class="sidebar-tools-main tools-wide">
<div class="dropdown">
<a href="" title="" id="quarto-navigation-tool-dropdown-0" class="quarto-navigation-tool dropdown-toggle px-1" data-bs-toggle="dropdown" aria-expanded="false" role="link" aria-label=""><i class="bi bi-translate"></i></a>
@@ -246,7 +292,7 @@ ul.task-list li input[type="checkbox"] {
</li>
</ul>
</div>
<a href="./Vom-Aufruf-zum-Ereignis.pdf" title="Download PDF" class="quarto-navigation-tool px-1" aria-label="Download PDF"><i class="bi bi-file-pdf"></i></a>
<a href="./Prozesssteuerung.pdf" title="Download PDF" class="quarto-navigation-tool px-1" aria-label="Download PDF"><i class="bi bi-file-pdf"></i></a>
<a href="" class="quarto-reader-toggle quarto-navigation-tool px-1" onclick="window.quartoToggleReader(); return false;" title="Lesemodus umschalten">
<div class="quarto-reader-toggle-btn">
<i class="bi"></i>
@@ -271,7 +317,7 @@ ul.task-list li input[type="checkbox"] {
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./00-orientation.html" class="sidebar-item-text sidebar-link active">
<span class="menu-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Schritt 0 — Worum es im Tutorial geht</span></span></a>
<span class="menu-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Schritt 0 — Worum es geht</span></span></a>
</div>
</li>
<li class="sidebar-item">
@@ -285,6 +331,23 @@ ul.task-list li input[type="checkbox"] {
<a href="./02-part-ii-processes.html" class="sidebar-item-text sidebar-link">
<span class="menu-text"><span class="chapter-number">3</span>&nbsp; <span class="chapter-title">Teil II — Die Prozessgrenze überschreiten</span></span></a>
</div>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a class="sidebar-item-text sidebar-link text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" role="navigation" aria-expanded="false">
<span class="menu-text">Anhang</span></a>
<a class="sidebar-item-toggle text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" role="navigation" aria-expanded="false" aria-label="Abschnitt umschalten">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-1" class="collapse list-unstyled sidebar-section depth1 ">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./glossary.html" class="sidebar-item-text sidebar-link">
<span class="menu-text">Glossar</span></a>
</div>
</li>
</ul>
</li>
</ul>
</div>
@@ -305,7 +368,7 @@ ul.task-list li input[type="checkbox"] {
<header id="title-block-header" class="quarto-title-block default">
<div class="quarto-title">
<h1 class="title"><span id="sec-step-0" class="quarto-section-identifier"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Schritt 0 — Worum es im Tutorial geht</span></span></h1>
<h1 class="title"><span id="sec-step-0" class="quarto-section-identifier"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Schritt 0 — Worum es geht</span></span></h1>
</div>
@@ -324,11 +387,11 @@ ul.task-list li input[type="checkbox"] {
<!-- MULTILINGUAL: see the comment at the top of index.qmd. -->
<p>Schritt 0 enthält keinen Code. Er nennt das Thema: nicht ROT13, sondern die Architektur darum herum. Die Funktionalität bleibt über 81 Schritte fast unverändert — genau das macht die Veränderungen ringsherum sichtbar.</p>
<p>Zwei Regeln werden hier gesetzt und gelten für das ganze Tutorial:</p>
<p>Zwei Regeln werden hier gesetzt und gelten bis zum Schluss:</p>
<blockquote class="blockquote">
<p><strong>Einer Lösung erst begegnen, nachdem man das Problem erlebt hat, das sie löst.</strong></p>
</blockquote>
<p>Deshalb beginnt das Tutorial nicht mit MQTT und auch nicht mit dynamischen Abonnements. Es baut zuerst ein System mit absichtlich unbequemen Vermittlern, nimmt es in Betrieb und fragt erst dann, ob sie ihren Platz verdient haben.</p>
<p>Deshalb beginnt der Aufbau nicht mit MQTT und auch nicht mit dynamischen Abonnements. Zuerst entsteht ein System mit absichtlich unbequemen Vermittlern, wird in Betrieb genommen, und erst dann wird gefragt, ob sie ihren Platz verdient haben.</p>
<p>Die zweite Regel betrifft das Vokabular: <em>Intent</em>, <em>Status/State</em> und <em>Event</em> werden erst benannt, nachdem sie benutzt wurden. Sie erscheinen etwa ab Schritt 42, nicht früher.</p>
<p>Die geplante Route, von Schritt 0 an:</p>
<pre class="text"><code>direct method calls → egoistic services → mediators → separate processes
@@ -345,7 +408,7 @@ ul.task-list li input[type="checkbox"] {
</colgroup>
<thead>
<tr class="header">
<th>Das Tutorial fragt</th>
<th>So gefragt</th>
<th>Eine schwächere Fassung</th>
</tr>
</thead>
+86 -23
View File
@@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>2&nbsp; Teil I — Mit dem beginnen, was man schon kennt – Vom Aufruf zum Ereignis</title>
<title>2&nbsp; Teil I — Mit dem beginnen, was man schon kennt – Prozesssteuerung</title>
<style>
/* Default styles provided by pandoc.
** See https://pandoc.org/MANUAL.html#variables-for-html for config info.
@@ -85,9 +85,15 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<link href="site_libs/bootstrap/bootstrap-cfe7114cbc4adb2af5ff3a891545d7fa.min.css" rel="stylesheet" append-hash="true" id="quarto-bootstrap" data-mode="light">
<script src="site_libs/quarto-contrib/calc-exo-2.0.0/exo.js"></script>
<link href="site_libs/quarto-contrib/calc-exo-2.0.0/exo.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-quiz-1.0.0/quiz.js"></script>
<link href="site_libs/quarto-contrib/calc-quiz-1.0.0/quiz.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-further-1.0.0/further.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-latex-tables-1.0.0/latex-tables.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-notes-1.0.0/calc-notes.js"></script>
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/theme.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/high-contrast.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/calc-notes.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/narrow.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-glossary-2.0.0/glossary.js"></script>
<link href="site_libs/quarto-contrib/calc-glossary-2.0.0/glossary.css" rel="stylesheet">
<script id="quarto-search-options" type="application/json">{
@@ -130,7 +136,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
nothing is attached to the links themselves: one capture-phase listener on
the document reads the link's final address at click time.
If a language has not been built (./render-all.sh), its pages do not exist:
If a language has not been built, its pages do not exist:
the target is checked first and a short note is shown instead of a
"Not Found" page.
@@ -146,12 +152,9 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
var ROOT_LANG = 'en'; // the language at the top of _book/
var COOKIE = 'notes-lang';
var NOTE = {
de: 'Diese Sprache wurde noch nicht erstellt. Einmal ./render-all.sh ausführen – '
+ 'danach funktioniert der Wechsel auch in der Vorschau.',
fr: 'Cette langue n’a pas encore été générée. Lancez une fois ./render-all.sh : '
+ 'ensuite le changement fonctionne aussi dans l’aperçu.',
en: 'This language hasn’t been built yet. Run ./render-all.sh once, '
+ 'then switching works in the preview too.'
de: 'Diese Sprache ist hier noch nicht verfügbar.',
fr: 'Cette langue n’est pas encore disponible ici.',
en: 'This language is not available here yet.'
};
var here = (document.documentElement.lang || ROOT_LANG).slice(0, 2);
@@ -165,9 +168,20 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
var m = document.cookie.match(/(?:^|;\s*)notes-lang=(de|fr|en)(?:;|$)/);
return m ? m[1] : null;
}
// path '/' on purpose: every book of these notes is served from one host,
// each under its own folder, so a language picked in any of them is the
// language all of them open in. A book hosted on its own would be no worse
// off -- the cookie simply has nothing else to reach.
var COOKIE_PATH = '/';
function remember(code) {
document.cookie = COOKIE + '=' + code + '; path=' + root + '; max-age=31536000; SameSite=Lax'
document.cookie = COOKIE + '=' + code + '; path=' + COOKIE_PATH
+ '; max-age=31536000; SameSite=Lax'
+ (location.protocol === 'https:' ? '; Secure' : '');
// a copy written under the book's own path by an earlier version would be
// the more specific one and would shadow the shared cookie for good
if (root !== COOKIE_PATH) {
document.cookie = COOKIE + '=; path=' + root + '; max-age=0';
}
}
// a returning reader lands in the language picked last time
@@ -189,7 +203,11 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
box.style.cssText = 'position:fixed;left:50%;bottom:1.25rem;transform:translateX(-50%);'
+ 'max-width:min(34rem,calc(100vw - 2rem));padding:.6rem .9rem;border-radius:6px;'
+ 'background:#1f2328;color:#fff;font-size:.85rem;line-height:1.4;z-index:2000;'
+ 'box-shadow:0 4px 16px rgba(0,0,0,.25)';
// a status message, so it keeps its own dark surface in either mode; the
// hairline is the page's rule colour, invisible on a light page and an
// edge against a dark one, where the shadow alone no longer separates it
+ 'border:1px solid var(--calc-line,#444);'
+ 'box-shadow:0 4px 16px var(--calc-shadow,rgba(0,0,0,.25))';
document.body.appendChild(box);
setTimeout(function () { box.remove(); }, 7000);
}
@@ -230,7 +248,35 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
}, true);
})();
</script>
<style>:root { --calc-notecolor: #B45309; }</style>
<style>:root {
--calc-furthercolor-src: #6B3FA0;
--calc-furthercolor: var(--calc-furthercolor-src);
}</style>
<style>:root {
--calc-notecolor-src: #B45309;
--calc-notecolor: var(--calc-notecolor-src);
}</style>
<script>(function (e) {
var KEY = 'notes-contrast', forced = false;
var picked = null;
try { picked = localStorage.getItem(KEY); } catch (err) {}
var q = null;
try { q = window.matchMedia && window.matchMedia('(prefers-contrast: more)'); } catch (err) {}
if (picked === 'more' || (picked !== 'normal' && (forced || (q && q.matches)))) {
e.classList.add('hc');
}
if (q) {
var f = function () {
var p = null;
try { p = localStorage.getItem(KEY); } catch (err) {}
if (p === null) e.classList.toggle('hc', forced || q.matches);
};
if (q.addEventListener) q.addEventListener('change', f);
else if (q.addListener) q.addListener(f);
}
})(document.documentElement);</script>
</head>
@@ -259,7 +305,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<nav id="quarto-sidebar" class="sidebar collapse collapse-horizontal quarto-sidebar-collapse-item sidebar-navigation docked overflow-auto">
<div class="pt-lg-2 mt-2 text-left sidebar-header">
<div class="sidebar-title mb-0 py-0">
<a href="./">Vom Aufruf zum Ereignis</a>
<a href="./">Prozesssteuerung</a>
<div class="sidebar-tools-main tools-wide">
<div class="dropdown">
<a href="" title="" id="quarto-navigation-tool-dropdown-0" class="quarto-navigation-tool dropdown-toggle px-1" data-bs-toggle="dropdown" aria-expanded="false" role="link" aria-label=""><i class="bi bi-translate"></i></a>
@@ -281,7 +327,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
</li>
</ul>
</div>
<a href="./Vom-Aufruf-zum-Ereignis.pdf" title="Download PDF" class="quarto-navigation-tool px-1" aria-label="Download PDF"><i class="bi bi-file-pdf"></i></a>
<a href="./Prozesssteuerung.pdf" title="Download PDF" class="quarto-navigation-tool px-1" aria-label="Download PDF"><i class="bi bi-file-pdf"></i></a>
<a href="" class="quarto-reader-toggle quarto-navigation-tool px-1" onclick="window.quartoToggleReader(); return false;" title="Lesemodus umschalten">
<div class="quarto-reader-toggle-btn">
<i class="bi"></i>
@@ -306,7 +352,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./00-orientation.html" class="sidebar-item-text sidebar-link">
<span class="menu-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Schritt 0 — Worum es im Tutorial geht</span></span></a>
<span class="menu-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Schritt 0 — Worum es geht</span></span></a>
</div>
</li>
<li class="sidebar-item">
@@ -320,6 +366,23 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<a href="./02-part-ii-processes.html" class="sidebar-item-text sidebar-link">
<span class="menu-text"><span class="chapter-number">3</span>&nbsp; <span class="chapter-title">Teil II — Die Prozessgrenze überschreiten</span></span></a>
</div>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a class="sidebar-item-text sidebar-link text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" role="navigation" aria-expanded="false">
<span class="menu-text">Anhang</span></a>
<a class="sidebar-item-toggle text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" role="navigation" aria-expanded="false" aria-label="Abschnitt umschalten">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-1" class="collapse list-unstyled sidebar-section depth1 ">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./glossary.html" class="sidebar-item-text sidebar-link">
<span class="menu-text">Glossar</span></a>
</div>
</li>
</ul>
</li>
</ul>
</div>
@@ -398,7 +461,7 @@ Abbildung&nbsp;2.1: Die prozedurale Fassung. Die Verdrahtung steht im Code: <cod
<section id="sec-step-2" class="level2" data-number="2.2">
<h2 data-number="2.2" class="anchored" data-anchor-id="sec-step-2"><span class="header-section-number">2.2</span> Schritt 2 — Drei egoistische Fähigkeiten</h2>
<p>Eine <strong>egoistische</strong> Komponente sagt: ich weiss, was ich kann, welche Daten ich annehme und welche ich erzeuge — und den Geschäftsprozess um mich herum möchte ich lieber nicht kennen. Konkret: <code>ConsoleIn</code> darf kein <code>rot13(...)</code> enthalten, und <code>ROT13</code> kein <code>consoleOut(...)</code>.</p>
<p>Das Entfernen dieser Aufrufe schafft sofort ein Problem, das das Tutorial als Frage stellt: wenn niemand niemanden kennt, <strong>wer macht daraus ein System?</strong> Zu beachten ist, was die Frage nicht sagt: das Wissen ist nicht verschwunden, es muss woandershin. Es fehlen zwei Verbindungen, nicht eine — <code>ConsoleIn ↔︎ ROT13</code> und <code>ROT13 ↔︎ ConsoleOut</code>.</p>
<p>Das Entfernen dieser Aufrufe schafft sofort ein Problem, das sich als Frage stellen lässt: wenn niemand niemanden kennt, <strong>wer macht daraus ein System?</strong> Zu beachten ist, was die Frage nicht sagt: das Wissen ist nicht verschwunden, es muss woandershin. Es fehlen zwei Verbindungen, nicht eine — <code>ConsoleIn ↔︎ ROT13</code> und <code>ROT13 ↔︎ ConsoleOut</code>.</p>
</section>
<section id="sec-step-3" class="level2" data-number="2.3">
<h2 data-number="2.3" class="anchored" data-anchor-id="sec-step-3"><span class="header-section-number">2.3</span> Schritt 3 — Jeder Fähigkeit ein Postfach geben</h2>
@@ -410,7 +473,7 @@ Abbildung&nbsp;2.1: Die prozedurale Fassung. Die Verdrahtung steht im Code: <cod
<span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a><span class="bu">BlockingQueue</span><span class="op">&lt;</span>Message<span class="op">&gt;</span> <span class="fu">mailbox</span><span class="op">(</span><span class="bu">String</span> name<span class="op">)</span> <span class="op">{</span></span>
<span id="cb2-6"><a href="#cb2-6" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> mailboxes<span class="op">.</span><span class="fu">computeIfAbsent</span><span class="op">(</span>name<span class="op">,</span> _ <span class="op">-&gt;</span> <span class="kw">new</span> <span class="bu">LinkedBlockingQueue</span><span class="op">&lt;&gt;());</span></span>
<span id="cb2-7"><a href="#cb2-7" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div><button title="In die Zwischenablage kopieren" class="code-copy-button"><i class="bi"></i></button></div>
<p>Das Tutorial nennt diese bewusst <strong>Postfächer</strong> (<em>mailboxes</em>) und nicht Topics, mit Begründung: rufen zwei Leser <code>take()</code> auf demselben Postfach auf, konkurrieren sie — jede Nachricht geht an <em>genau einen</em> von ihnen und wird nicht an beide kopiert. Ein Topic in Publish/Subscribe gäbe jedem Abonnenten seine eigene Kopie. Ein Leser pro Nachricht genügt vorläufig, und die Einschränkung bleibt absichtlich bestehen: sie macht später sichtbar, was Publish/Subscribe wirklich hinzufügt.</p>
<p>Das sind bewusst <strong>Postfächer</strong> (<em>mailboxes</em>) und keine Topics, und der Unterschied ist wichtig: rufen zwei Leser <code>take()</code> auf demselben Postfach auf, konkurrieren sie — jede Nachricht geht an <em>genau einen</em> von ihnen und wird nicht an beide kopiert. Ein Topic in Publish/Subscribe gäbe jedem Abonnenten seine eigene Kopie. Ein Leser pro Nachricht genügt vorläufig, und die Einschränkung bleibt absichtlich bestehen: sie macht später sichtbar, was Publish/Subscribe wirklich hinzufügt.</p>
</section>
<section id="sec-steps-4-6" class="level2" data-number="2.4">
<h2 data-number="2.4" class="anchored" data-anchor-id="sec-steps-4-6"><span class="header-section-number">2.4</span> Schritte 4–6 — Die drei Fähigkeiten werden egoistisch</h2>
@@ -441,7 +504,7 @@ Abbildung&nbsp;2.1: Die prozedurale Fassung. Die Verdrahtung steht im Code: <cod
</tr>
</tbody>
</table>
<p>Keine Fähigkeit enthält den Namen einer anderen. Die Zusammenfassung des Tutorials selbst: „drei schön isolierte Fähigkeiten. Und sie tun zusammen absolut nichts.” Nichts bewegt eine Nachricht von <code>consoleIn.outbox</code> nach <code>rot13.inbox</code> oder von <code>rot13.outbox</code> nach <code>consoleOut.inbox</code>.</p>
<p>Keine Fähigkeit enthält den Namen einer anderen, und genau das ist das Ergebnis: drei schön isolierte Fähigkeiten, die zusammen absolut nichts tun. Nichts bewegt eine Nachricht von <code>consoleIn.outbox</code> nach <code>rot13.inbox</code> oder von <code>rot13.outbox</code> nach <code>consoleOut.inbox</code>.</p>
</section>
<section id="sec-step-7" class="level2" data-number="2.5">
<h2 data-number="2.5" class="anchored" data-anchor-id="sec-step-7"><span class="header-section-number">2.5</span> Schritt 7 — Auftritt des Vermittlers</h2>
@@ -466,7 +529,7 @@ Abbildung&nbsp;2.2: Die vermittelte Fassung in einer JVM. In der Webfassung schi
<section id="sec-step-8" class="level2" data-number="2.6">
<h2 data-number="2.6" class="anchored" data-anchor-id="sec-step-8"><span class="header-section-number">2.6</span> Schritt 8 — Nochmals fragen: wer kennt wen?</h2>
<p>Kennt ConsoleIn ROT13? Nein. Kennt ROT13 ConsoleIn oder ConsoleOut? Nein. Ist die Topologie verschwunden? Nein — sie steckt in den zwei <code>mediate(...)</code>-Aufrufen innerhalb von <code>main()</code>.</p>
<p>Das ist das erste grosse Ergebnis des Tutorials:</p>
<p>Das ist das erste grosse Ergebnis:</p>
<blockquote class="blockquote">
<p><strong>Entkopplung lässt Wissen oft nicht verschwinden. Sie verschiebt Wissen dorthin, wo es hingehört.</strong></p>
</blockquote>
@@ -475,7 +538,7 @@ Abbildung&nbsp;2.2: Die vermittelte Fassung in einer JVM. In der Webfassung schi
<section id="sec-step-9" class="level2" data-number="2.7">
<h2 data-number="2.7" class="anchored" data-anchor-id="sec-step-9"><span class="header-section-number">2.7</span> Schritt 9 — Warum virtuelle Threads?</h2>
<p>Fünf Schleifen warten nun unbegrenzt: die Tastatur, <code>rot13.inbox</code>, <code>consoleOut.inbox</code> und die Quellen der zwei Vermittler. Virtuelle Threads sind einfach der billige Java-Weg, fünf Wartevorgänge gleichzeitig in einer JVM laufen zu lassen.</p>
<p>Sie sind eine Implementierungsbequemlichkeit, keine Architektur. Die Architektur — wer wen kennt und wo die Verdrahtung liegt — steckt in den Postfachnamen, nicht in den Threads. Der Beleg des Tutorials für die Trennung: dieselbe Architektur läuft in Schritt 11 als getrennte Prozesse, ohne geteilte Threads zwischen den Teilen.</p>
<p>Sie sind eine Implementierungsbequemlichkeit, keine Architektur. Die Architektur — wer wen kennt und wo die Verdrahtung liegt — steckt in den Postfachnamen, nicht in den Threads. Der Beleg für die Trennung: dieselbe Architektur läuft in Schritt 11 als getrennte Prozesse, ohne geteilte Threads zwischen den Teilen.</p>
</section>
<section id="sec-step-10" class="level2" data-number="2.8">
<h2 data-number="2.8" class="anchored" data-anchor-id="sec-step-10"><span class="header-section-number">2.8</span> Schritt 10 — Die Dienste egoistisch halten</h2>
@@ -507,7 +570,7 @@ Abbildung&nbsp;2.2: Die vermittelte Fassung in einer JVM. In der Webfassung schi
</tr>
</tbody>
</table>
<p>Das Tutorial ist ehrlich über den Preis: dieses Design „mag indirekt wirken — sogar etwas eigenartig”, und es verspricht einen anderen Weg, Dienste egoistisch zu halten, <em>ohne</em> Vermittler im Pfad jeder Nachricht.</p>
<p>Der Preis gehört klar gesagt: dieses Design mag indirekt wirken — sogar etwas eigenartig. Es gibt einen anderen Weg, Dienste egoistisch zu halten, <em>ohne</em> Vermittler im Pfad jeder Nachricht; er kommt später.</p>
</section>
<section id="sec-part-i-result" class="level2" data-number="2.9">
<h2 data-number="2.9" class="anchored" data-anchor-id="sec-part-i-result"><span class="header-section-number">2.9</span> Was Teil I verschoben hat</h2>
@@ -537,7 +600,7 @@ Abbildung&nbsp;2.2: Die vermittelte Fassung in einer JVM. In der Webfassung schi
</tr>
</tbody>
</table>
<p>Funktionalität: unverändert. Codezeilen: mehr. Teile, die einander kennen: keine. Das ist der Tauschhandel, den das restliche Tutorial immer wieder prüft.</p>
<p>Funktionalität: unverändert. Codezeilen: mehr. Teile, die einander kennen: keine. Das ist der Tauschhandel, den alles Folgende immer wieder prüft.</p>
</section>
@@ -1164,8 +1227,8 @@ Abbildung&nbsp;2.2: Die vermittelte Fassung in einer JVM. In der Webfassung schi
</script>
<nav class="page-navigation">
<div class="nav-page nav-page-previous">
<a href="./00-orientation.html" class="pagination-link" aria-label="[Step 0 — What the tutorial is about]{.en}[Étape 0 — De quoi parle le tutoriel]{.fr}[Schritt 0 — Worum es im Tutorial geht]{.de}">
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Schritt 0 — Worum es im Tutorial geht</span></span>
<a href="./00-orientation.html" class="pagination-link" aria-label="[Step 0 — What this is about]{.en}[Étape 0 — De quoi il s'agit]{.fr}[Schritt 0 — Worum es geht]{.de}">
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Schritt 0 — Worum es geht</span></span>
</a>
</div>
<div class="nav-page nav-page-next">
+86 -19
View File
@@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>3&nbsp; Teil II — Die Prozessgrenze überschreiten – Vom Aufruf zum Ereignis</title>
<title>3&nbsp; Teil II — Die Prozessgrenze überschreiten – Prozesssteuerung</title>
<style>
/* Default styles provided by pandoc.
** See https://pandoc.org/MANUAL.html#variables-for-html for config info.
@@ -71,6 +71,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<script src="site_libs/quarto-search/fuse.min.js"></script>
<script src="site_libs/quarto-search/quarto-search.js"></script>
<meta name="quarto:offset" content="./">
<link href="./glossary.html" rel="next">
<link href="./01-part-i-calls.html" rel="prev">
<script src="site_libs/quarto-html/quarto.js" type="module"></script>
<script src="site_libs/quarto-html/tabsets/tabsets.js" type="module"></script>
@@ -84,9 +85,15 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<link href="site_libs/bootstrap/bootstrap-cfe7114cbc4adb2af5ff3a891545d7fa.min.css" rel="stylesheet" append-hash="true" id="quarto-bootstrap" data-mode="light">
<script src="site_libs/quarto-contrib/calc-exo-2.0.0/exo.js"></script>
<link href="site_libs/quarto-contrib/calc-exo-2.0.0/exo.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-quiz-1.0.0/quiz.js"></script>
<link href="site_libs/quarto-contrib/calc-quiz-1.0.0/quiz.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-further-1.0.0/further.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-latex-tables-1.0.0/latex-tables.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-notes-1.0.0/calc-notes.js"></script>
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/theme.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/high-contrast.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/calc-notes.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/narrow.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-glossary-2.0.0/glossary.js"></script>
<link href="site_libs/quarto-contrib/calc-glossary-2.0.0/glossary.css" rel="stylesheet">
<script id="quarto-search-options" type="application/json">{
@@ -129,7 +136,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
nothing is attached to the links themselves: one capture-phase listener on
the document reads the link's final address at click time.
If a language has not been built (./render-all.sh), its pages do not exist:
If a language has not been built, its pages do not exist:
the target is checked first and a short note is shown instead of a
"Not Found" page.
@@ -145,12 +152,9 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
var ROOT_LANG = 'en'; // the language at the top of _book/
var COOKIE = 'notes-lang';
var NOTE = {
de: 'Diese Sprache wurde noch nicht erstellt. Einmal ./render-all.sh ausführen – '
+ 'danach funktioniert der Wechsel auch in der Vorschau.',
fr: 'Cette langue n’a pas encore été générée. Lancez une fois ./render-all.sh : '
+ 'ensuite le changement fonctionne aussi dans l’aperçu.',
en: 'This language hasn’t been built yet. Run ./render-all.sh once, '
+ 'then switching works in the preview too.'
de: 'Diese Sprache ist hier noch nicht verfügbar.',
fr: 'Cette langue n’est pas encore disponible ici.',
en: 'This language is not available here yet.'
};
var here = (document.documentElement.lang || ROOT_LANG).slice(0, 2);
@@ -164,9 +168,20 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
var m = document.cookie.match(/(?:^|;\s*)notes-lang=(de|fr|en)(?:;|$)/);
return m ? m[1] : null;
}
// path '/' on purpose: every book of these notes is served from one host,
// each under its own folder, so a language picked in any of them is the
// language all of them open in. A book hosted on its own would be no worse
// off -- the cookie simply has nothing else to reach.
var COOKIE_PATH = '/';
function remember(code) {
document.cookie = COOKIE + '=' + code + '; path=' + root + '; max-age=31536000; SameSite=Lax'
document.cookie = COOKIE + '=' + code + '; path=' + COOKIE_PATH
+ '; max-age=31536000; SameSite=Lax'
+ (location.protocol === 'https:' ? '; Secure' : '');
// a copy written under the book's own path by an earlier version would be
// the more specific one and would shadow the shared cookie for good
if (root !== COOKIE_PATH) {
document.cookie = COOKIE + '=; path=' + root + '; max-age=0';
}
}
// a returning reader lands in the language picked last time
@@ -188,7 +203,11 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
box.style.cssText = 'position:fixed;left:50%;bottom:1.25rem;transform:translateX(-50%);'
+ 'max-width:min(34rem,calc(100vw - 2rem));padding:.6rem .9rem;border-radius:6px;'
+ 'background:#1f2328;color:#fff;font-size:.85rem;line-height:1.4;z-index:2000;'
+ 'box-shadow:0 4px 16px rgba(0,0,0,.25)';
// a status message, so it keeps its own dark surface in either mode; the
// hairline is the page's rule colour, invisible on a light page and an
// edge against a dark one, where the shadow alone no longer separates it
+ 'border:1px solid var(--calc-line,#444);'
+ 'box-shadow:0 4px 16px var(--calc-shadow,rgba(0,0,0,.25))';
document.body.appendChild(box);
setTimeout(function () { box.remove(); }, 7000);
}
@@ -229,7 +248,35 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
}, true);
})();
</script>
<style>:root { --calc-notecolor: #B45309; }</style>
<style>:root {
--calc-furthercolor-src: #6B3FA0;
--calc-furthercolor: var(--calc-furthercolor-src);
}</style>
<style>:root {
--calc-notecolor-src: #B45309;
--calc-notecolor: var(--calc-notecolor-src);
}</style>
<script>(function (e) {
var KEY = 'notes-contrast', forced = false;
var picked = null;
try { picked = localStorage.getItem(KEY); } catch (err) {}
var q = null;
try { q = window.matchMedia && window.matchMedia('(prefers-contrast: more)'); } catch (err) {}
if (picked === 'more' || (picked !== 'normal' && (forced || (q && q.matches)))) {
e.classList.add('hc');
}
if (q) {
var f = function () {
var p = null;
try { p = localStorage.getItem(KEY); } catch (err) {}
if (p === null) e.classList.toggle('hc', forced || q.matches);
};
if (q.addEventListener) q.addEventListener('change', f);
else if (q.addListener) q.addListener(f);
}
})(document.documentElement);</script>
</head>
@@ -258,7 +305,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<nav id="quarto-sidebar" class="sidebar collapse collapse-horizontal quarto-sidebar-collapse-item sidebar-navigation docked overflow-auto">
<div class="pt-lg-2 mt-2 text-left sidebar-header">
<div class="sidebar-title mb-0 py-0">
<a href="./">Vom Aufruf zum Ereignis</a>
<a href="./">Prozesssteuerung</a>
<div class="sidebar-tools-main tools-wide">
<div class="dropdown">
<a href="" title="" id="quarto-navigation-tool-dropdown-0" class="quarto-navigation-tool dropdown-toggle px-1" data-bs-toggle="dropdown" aria-expanded="false" role="link" aria-label=""><i class="bi bi-translate"></i></a>
@@ -280,7 +327,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
</li>
</ul>
</div>
<a href="./Vom-Aufruf-zum-Ereignis.pdf" title="Download PDF" class="quarto-navigation-tool px-1" aria-label="Download PDF"><i class="bi bi-file-pdf"></i></a>
<a href="./Prozesssteuerung.pdf" title="Download PDF" class="quarto-navigation-tool px-1" aria-label="Download PDF"><i class="bi bi-file-pdf"></i></a>
<a href="" class="quarto-reader-toggle quarto-navigation-tool px-1" onclick="window.quartoToggleReader(); return false;" title="Lesemodus umschalten">
<div class="quarto-reader-toggle-btn">
<i class="bi"></i>
@@ -305,7 +352,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./00-orientation.html" class="sidebar-item-text sidebar-link">
<span class="menu-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Schritt 0 — Worum es im Tutorial geht</span></span></a>
<span class="menu-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Schritt 0 — Worum es geht</span></span></a>
</div>
</li>
<li class="sidebar-item">
@@ -319,6 +366,23 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<a href="./02-part-ii-processes.html" class="sidebar-item-text sidebar-link active">
<span class="menu-text"><span class="chapter-number">3</span>&nbsp; <span class="chapter-title">Teil II — Die Prozessgrenze überschreiten</span></span></a>
</div>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a class="sidebar-item-text sidebar-link text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" role="navigation" aria-expanded="false">
<span class="menu-text">Anhang</span></a>
<a class="sidebar-item-toggle text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" role="navigation" aria-expanded="false" aria-label="Abschnitt umschalten">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-1" class="collapse list-unstyled sidebar-section depth1 ">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./glossary.html" class="sidebar-item-text sidebar-link">
<span class="menu-text">Glossar</span></a>
</div>
</li>
</ul>
</li>
</ul>
</div>
@@ -367,7 +431,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<section id="sec-step-11" class="level2" data-number="3.1">
<h2 data-number="3.1" class="anchored" data-anchor-id="sec-step-11"><span class="header-section-number">3.1</span> Schritt 11 — Die Komponenten trennen</h2>
<p>Drei Prozesse können keine <code>BlockingQueue</code> teilen: jeder <code>java</code>-Befehl startet seine eigene JVM mit eigenem Speicher, die <code>mailboxes</code>-Map existierte also dreimal, und jede Kopie sähe nur ihre eigenen Nachrichten. Ein externer Transport ist nötig.</p>
<p>TCP würde gehen, MQTT würde gehen. Das Tutorial wählt absichtlich die primitivste Möglichkeit, das <strong>Dateisystem</strong>, mit einer einzeiligen Begründung: <em>weil man es sehen kann</em>. Nachrichten werden Dateien, die man mit <code>ls</code> auflisten und mit <code>cat</code> lesen kann, während das System läuft. Primitiv heisst hier nicht schlechter; Teil VIII kommt darauf zurück, was das Dateisystem wirklich gut und wirklich schlecht kann.</p>
<p>TCP würde gehen, MQTT würde gehen. Absichtlich fällt die Wahl auf die primitivste Möglichkeit, das <strong>Dateisystem</strong>, mit einer einzeiligen Begründung: <em>weil man es sehen kann</em>. Nachrichten werden Dateien, die man mit <code>ls</code> auflisten und mit <code>cat</code> lesen kann, während das System läuft. Primitiv heisst hier nicht schlechter; Teil VIII kommt darauf zurück, was das Dateisystem wirklich gut und wirklich schlecht kann.</p>
</section>
<section id="sec-steps-12-13" class="level2" data-number="3.2">
<h2 data-number="3.2" class="anchored" data-anchor-id="sec-steps-12-13"><span class="header-section-number">3.2</span> Schritte 12–13 — Ein Verzeichnis wird zum Postfach</h2>
@@ -410,7 +474,7 @@ TIMESTAMP: 2026-09-22T10:42:12.123Z</code></pre>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb5"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="bu">printf</span> <span class="st">'TEXT\nHello from a file'</span> <span class="op">&gt;</span> messageBoard/consoleOut/inbox/manual.tmp</span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a><span class="fu">mv</span> messageBoard/consoleOut/inbox/manual.tmp messageBoard/consoleOut/inbox/manual.msg</span></code></pre></div><button title="In die Zwischenablage kopieren" class="code-copy-button"><i class="bi"></i></button></div>
<p><strong>Beobachtet:</strong> beim Auftauchen der <code>.tmp</code>-Datei geschieht nichts; die Zeile erscheint in dem Moment, in dem das Umbenennen den <code>.msg</code>-Namen erzeugt. Beide erlaubten Formate funktionieren, mit und ohne abschliessenden Zeitstempel.</p>
<p>Die architektonische Lehre ist die, die das Tutorial als <code>producer → filesystem → consumer</code> zieht: der Konsument konnte einen Menschen, der <code>mv</code> tippt, nicht von einem echten Dienst unterscheiden. Er kennt sein eigenes Eingangspostfach, nicht den, der hineinschreibt. Der Egoismus hat die Prozessgrenze überlebt.</p>
<p>Die architektonische Lehre lautet <code>producer → filesystem → consumer</code>: der Konsument konnte einen Menschen, der <code>mv</code> tippt, nicht von einem echten Dienst unterscheiden. Er kennt sein eigenes Eingangspostfach, nicht den, der hineinschreibt. Der Egoismus hat die Prozessgrenze überlebt.</p>
</section>
<section id="sec-steps-16-17" class="level2" data-number="3.5">
<h2 data-number="3.5" class="anchored" data-anchor-id="sec-steps-16-17"><span class="header-section-number">3.5</span> Schritte 16–17 — Dienste und Vermittler werden Prozesse</h2>
@@ -457,8 +521,8 @@ TIMESTAMP: 2026-09-22T10:42:12.123Z</code></pre>
</tr>
</tbody>
</table>
<p>Der Vermittler ist generisch: seine Route ist nicht einkompiliert, sie kommt als zwei Startargumente. Doch das Tutorial weist auf eine Asymmetrie hin, die man im Kopf behalten sollte: die drei Fähigkeiten erhalten ihre <strong>Arbeit</strong> als Nachrichten in einem Postfach, der Vermittler dagegen seine <strong>Route</strong> als Startkonfiguration — und er hat keinen Namen und kein eigenes Steuerpostfach, in das jemand schreiben könnte.</p>
<p>Praktische Folge: Argumente werden einmal gelesen, das Ändern der Route eines laufenden Vermittlers heisst also: anhalten und neu starten. Eine Konfigurationsdatei wäre nicht anders — auch sie wird beim Start gelesen. Das Tutorial lässt diesen Punkt absichtlich offen, bis die Kosten der verteilten Vermittler zu spüren waren.</p>
<p>Der Vermittler ist generisch: seine Route ist nicht einkompiliert, sie kommt als zwei Startargumente. Doch eine Asymmetrie sollte man im Kopf behalten: die drei Fähigkeiten erhalten ihre <strong>Arbeit</strong> als Nachrichten in einem Postfach, der Vermittler dagegen seine <strong>Route</strong> als Startkonfiguration — und er hat keinen Namen und kein eigenes Steuerpostfach, in das jemand schreiben könnte.</p>
<p>Praktische Folge: Argumente werden einmal gelesen, das Ändern der Route eines laufenden Vermittlers heisst also: anhalten und neu starten. Eine Konfigurationsdatei wäre nicht anders — auch sie wird beim Start gelesen. Dieser Punkt bleibt absichtlich offen, bis die Kosten der verteilten Vermittler zu spüren waren.</p>
</section>
<section id="sec-step-18" class="level2" data-number="3.6">
<h2 data-number="3.6" class="anchored" data-anchor-id="sec-step-18"><span class="header-section-number">3.6</span> Schritt 18 — Die vollständig externe lokale Fassung ausführen</h2>
@@ -469,7 +533,7 @@ TIMESTAMP: 2026-09-22T10:42:12.123Z</code></pre>
<span id="cb6-4"><a href="#cb6-4" aria-hidden="true" tabindex="-1"></a><span class="ex">java</span> Mediator.java rot13/outbox consoleOut/inbox <span class="co"># terminal 4</span></span>
<span id="cb6-5"><a href="#cb6-5" aria-hidden="true" tabindex="-1"></a><span class="ex">java</span> ActuatorService.java <span class="co"># terminal 5</span></span></code></pre></div><button title="In die Zwischenablage kopieren" class="code-copy-button"><i class="bi"></i></button></div>
<p><strong>Beobachtet:</strong> <code>Hello World</code>, in Terminal 1 getippt, erschien als <code>Uryyb Jbeyq</code> in Terminal 5. Die drei mittleren Terminals zeigten nichts Neues — jeder Vermittler gibt beim Start eine Zeile „Mediating: …” aus, und <code>ProcessorService</code> gibt überhaupt nichts aus. Danach enthielt jedes der vier Postfachverzeichnisse eine <code>.msg</code>-Datei: dieselbe Zeile, entlang der Kette kopiert.</p>
<p>Nachzählen: <strong>fünf Prozesse</strong> für das, was Schritt 1 in einer Anweisung tat. Die Anweisung des Tutorials an dieser Stelle lautet nicht, zu optimieren: „We are not done making it painful.”</p>
<p>Nachzählen: <strong>fünf Prozesse</strong> für das, was Schritt 1 in einer Anweisung tat. Jetzt ist nicht der Moment zu optimieren: bequem soll es noch nicht sein.</p>
<div id="fig-filesystem-processes" class="flow-figure quarto-float quarto-figure quarto-figure-center anchored">
<figure class="quarto-float quarto-float-fig figure">
<div aria-describedby="fig-filesystem-processes-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
@@ -1146,6 +1210,9 @@ Abbildung&nbsp;3.1: Die fünf Prozesse und die vier Postfachverzeichnisse. In de
</a>
</div>
<div class="nav-page nav-page-next">
<a href="./glossary.html" class="pagination-link" aria-label="[Glossary]{.en}[Glossaire]{.fr}[Glossar]{.de}">
<span class="nav-page-text">Glossar</span> <i class="bi bi-arrow-right-short"></i>
</a>
</div>
</nav>
</div> <!-- /content -->
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -152,5 +152,5 @@ svg:not(:has(.node)) .node { opacity: 1; }
<!-- who knows whom -->
<text class="t-sm" data-label="knows" x="14" y="176">main() kennt alle drei: ihre Namen, Argument- und Ergebnistypen und dass sie sofort verfügbar sind.</text>
<text class="t-mut" data-label="cost" x="14" y="202">Die Verdrahtung steht im Code selbst — Schritt 1 des Tutorials.</text>
<text class="t-mut" data-label="cost" x="14" y="202">Die Verdrahtung steht im Code selbst — Schritt 1.</text>
</svg>

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

File diff suppressed because it is too large. Load diff
+88 -67
View File
@@ -7,9 +7,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<meta name="author" content="Romain De Groote">
<meta name="dcterms.date" content="2026-09-24">
<meta name="dcterms.date" content="2026-09-25">
<title>Vom Aufruf zum Ereignis</title>
<title>Prozesssteuerung</title>
<style>
/* Default styles provided by pandoc.
** See https://pandoc.org/MANUAL.html#variables-for-html for config info.
@@ -28,41 +28,6 @@ ul.task-list li input[type="checkbox"] {
margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */
vertical-align: middle;
}
/* CSS for syntax highlighting */
html { -webkit-text-size-adjust: 100%; }
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
}
pre.numberSource { margin-left: 3em; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
</style>
@@ -86,9 +51,15 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<link href="site_libs/bootstrap/bootstrap-cfe7114cbc4adb2af5ff3a891545d7fa.min.css" rel="stylesheet" append-hash="true" id="quarto-bootstrap" data-mode="light">
<script src="site_libs/quarto-contrib/calc-exo-2.0.0/exo.js"></script>
<link href="site_libs/quarto-contrib/calc-exo-2.0.0/exo.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-quiz-1.0.0/quiz.js"></script>
<link href="site_libs/quarto-contrib/calc-quiz-1.0.0/quiz.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-further-1.0.0/further.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-latex-tables-1.0.0/latex-tables.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-notes-1.0.0/calc-notes.js"></script>
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/theme.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/high-contrast.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/calc-notes.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/narrow.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-glossary-2.0.0/glossary.js"></script>
<link href="site_libs/quarto-contrib/calc-glossary-2.0.0/glossary.css" rel="stylesheet">
<script id="quarto-search-options" type="application/json">{
@@ -131,7 +102,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
nothing is attached to the links themselves: one capture-phase listener on
the document reads the link's final address at click time.
If a language has not been built (./render-all.sh), its pages do not exist:
If a language has not been built, its pages do not exist:
the target is checked first and a short note is shown instead of a
"Not Found" page.
@@ -147,12 +118,9 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
var ROOT_LANG = 'en'; // the language at the top of _book/
var COOKIE = 'notes-lang';
var NOTE = {
de: 'Diese Sprache wurde noch nicht erstellt. Einmal ./render-all.sh ausführen – '
+ 'danach funktioniert der Wechsel auch in der Vorschau.',
fr: 'Cette langue n’a pas encore été générée. Lancez une fois ./render-all.sh : '
+ 'ensuite le changement fonctionne aussi dans l’aperçu.',
en: 'This language hasn’t been built yet. Run ./render-all.sh once, '
+ 'then switching works in the preview too.'
de: 'Diese Sprache ist hier noch nicht verfügbar.',
fr: 'Cette langue n’est pas encore disponible ici.',
en: 'This language is not available here yet.'
};
var here = (document.documentElement.lang || ROOT_LANG).slice(0, 2);
@@ -166,9 +134,20 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
var m = document.cookie.match(/(?:^|;\s*)notes-lang=(de|fr|en)(?:;|$)/);
return m ? m[1] : null;
}
// path '/' on purpose: every book of these notes is served from one host,
// each under its own folder, so a language picked in any of them is the
// language all of them open in. A book hosted on its own would be no worse
// off -- the cookie simply has nothing else to reach.
var COOKIE_PATH = '/';
function remember(code) {
document.cookie = COOKIE + '=' + code + '; path=' + root + '; max-age=31536000; SameSite=Lax'
document.cookie = COOKIE + '=' + code + '; path=' + COOKIE_PATH
+ '; max-age=31536000; SameSite=Lax'
+ (location.protocol === 'https:' ? '; Secure' : '');
// a copy written under the book's own path by an earlier version would be
// the more specific one and would shadow the shared cookie for good
if (root !== COOKIE_PATH) {
document.cookie = COOKIE + '=; path=' + root + '; max-age=0';
}
}
// a returning reader lands in the language picked last time
@@ -190,7 +169,11 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
box.style.cssText = 'position:fixed;left:50%;bottom:1.25rem;transform:translateX(-50%);'
+ 'max-width:min(34rem,calc(100vw - 2rem));padding:.6rem .9rem;border-radius:6px;'
+ 'background:#1f2328;color:#fff;font-size:.85rem;line-height:1.4;z-index:2000;'
+ 'box-shadow:0 4px 16px rgba(0,0,0,.25)';
// a status message, so it keeps its own dark surface in either mode; the
// hairline is the page's rule colour, invisible on a light page and an
// edge against a dark one, where the shadow alone no longer separates it
+ 'border:1px solid var(--calc-line,#444);'
+ 'box-shadow:0 4px 16px var(--calc-shadow,rgba(0,0,0,.25))';
document.body.appendChild(box);
setTimeout(function () { box.remove(); }, 7000);
}
@@ -231,7 +214,35 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
}, true);
})();
</script>
<style>:root { --calc-notecolor: #B45309; }</style>
<style>:root {
--calc-furthercolor-src: #6B3FA0;
--calc-furthercolor: var(--calc-furthercolor-src);
}</style>
<style>:root {
--calc-notecolor-src: #B45309;
--calc-notecolor: var(--calc-notecolor-src);
}</style>
<script>(function (e) {
var KEY = 'notes-contrast', forced = false;
var picked = null;
try { picked = localStorage.getItem(KEY); } catch (err) {}
var q = null;
try { q = window.matchMedia && window.matchMedia('(prefers-contrast: more)'); } catch (err) {}
if (picked === 'more' || (picked !== 'normal' && (forced || (q && q.matches)))) {
e.classList.add('hc');
}
if (q) {
var f = function () {
var p = null;
try { p = localStorage.getItem(KEY); } catch (err) {}
if (p === null) e.classList.toggle('hc', forced || q.matches);
};
if (q.addEventListener) q.addEventListener('change', f);
else if (q.addListener) q.addListener(f);
}
})(document.documentElement);</script>
</head>
@@ -260,7 +271,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<nav id="quarto-sidebar" class="sidebar collapse collapse-horizontal quarto-sidebar-collapse-item sidebar-navigation docked overflow-auto">
<div class="pt-lg-2 mt-2 text-left sidebar-header">
<div class="sidebar-title mb-0 py-0">
<a href="./">Vom Aufruf zum Ereignis</a>
<a href="./">Prozesssteuerung</a>
<div class="sidebar-tools-main tools-wide">
<div class="dropdown">
<a href="" title="" id="quarto-navigation-tool-dropdown-0" class="quarto-navigation-tool dropdown-toggle px-1" data-bs-toggle="dropdown" aria-expanded="false" role="link" aria-label=""><i class="bi bi-translate"></i></a>
@@ -282,7 +293,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
</li>
</ul>
</div>
<a href="./Vom-Aufruf-zum-Ereignis.pdf" title="Download PDF" class="quarto-navigation-tool px-1" aria-label="Download PDF"><i class="bi bi-file-pdf"></i></a>
<a href="./Prozesssteuerung.pdf" title="Download PDF" class="quarto-navigation-tool px-1" aria-label="Download PDF"><i class="bi bi-file-pdf"></i></a>
<a href="" class="quarto-reader-toggle quarto-navigation-tool px-1" onclick="window.quartoToggleReader(); return false;" title="Lesemodus umschalten">
<div class="quarto-reader-toggle-btn">
<i class="bi"></i>
@@ -307,7 +318,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./00-orientation.html" class="sidebar-item-text sidebar-link">
<span class="menu-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Schritt 0 — Worum es im Tutorial geht</span></span></a>
<span class="menu-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Schritt 0 — Worum es geht</span></span></a>
</div>
</li>
<li class="sidebar-item">
@@ -321,6 +332,23 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<a href="./02-part-ii-processes.html" class="sidebar-item-text sidebar-link">
<span class="menu-text"><span class="chapter-number">3</span>&nbsp; <span class="chapter-title">Teil II — Die Prozessgrenze überschreiten</span></span></a>
</div>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a class="sidebar-item-text sidebar-link text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" role="navigation" aria-expanded="false">
<span class="menu-text">Anhang</span></a>
<a class="sidebar-item-toggle text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" role="navigation" aria-expanded="false" aria-label="Abschnitt umschalten">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-1" class="collapse list-unstyled sidebar-section depth1 ">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./glossary.html" class="sidebar-item-text sidebar-link">
<span class="menu-text">Glossar</span></a>
</div>
</li>
</ul>
</li>
</ul>
</div>
@@ -335,7 +363,6 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<li><a href="#sec-about" id="toc-sec-about" class="nav-link active" data-scroll-target="#sec-about">Über diese Notizen</a>
<ul class="collapse">
<li><a href="#sec-diagrams" id="toc-sec-diagrams" class="nav-link" data-scroll-target="#sec-diagrams">Wie die Abbildungen zu lesen sind</a></li>
<li><a href="#sec-build" id="toc-sec-build" class="nav-link" data-scroll-target="#sec-build">Dieses Buch bauen</a></li>
</ul></li>
</ul>
</nav>
@@ -345,7 +372,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<header id="title-block-header" class="quarto-title-block default">
<div class="quarto-title">
<h1 class="title">Vom Aufruf zum Ereignis</h1>
<h1 class="title">Prozesssteuerung</h1>
</div>
@@ -362,7 +389,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<div>
<div class="quarto-title-meta-heading">Veröffentlichungsdatum</div>
<div class="quarto-title-meta-contents">
<p class="date">24 September 2026</p>
<p class="date">25 September 2026</p>
</div>
</div>
@@ -372,7 +399,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<div>
<div class="abstract">
<div class="block-title">Zusammenfassung</div>
Schrittweise Zusammenfassungen des Tutorials SIN.04028 „From Calling to Eventing“, vom direkten Methodenaufruf zu einer ereignisgetriebenen Architektur über MQTT. Process Control, gehalten von Reto Konig, Universität Freiburg, Herbstsemester 2026.
Ein kleines Programm, Schritt für Schritt neu gebaut — vom direkten Methodenaufruf zu einer ereignisgetriebenen Architektur über MQTT: was sich bei jedem Schritt verschiebt und wer am Ende wen kennt.
</div>
</div>
@@ -395,34 +422,28 @@ MULTILINGUAL (see _extensions/notes/i18n.lua):
picture, just still.
- fixed section ids (#sec-...) so anchors are identical in all three books.
English is the verified source: the tutorial being summarised is written in
English. French and German are translations of it.
English is the verified source: the material these notes are built from is
written in English. French and German are translations of it.
Code identifiers, mailbox and topic names, file names, commands and protocol
terms are never translated (consoleIn.outbox, rot13/inbox, WatchService,
Mediator.java, .msg, put/take, Intent/Status/Event).
-->
<p>Diese Notizen fassen das Tutorial <strong>„SIN.04028 — From Calling to Eventing“</strong> zusammen, Schritt für Schritt durchgearbeitet. Das Tutorial selbst liegt neben diesem Buch, in <code>SIN.04028-From-Calling-to-Eventing/README.md</code>, und gehört zur Vorlesung <em>Process Control</em> von Reto Konig an der Universität Freiburg (Herbstsemester 2026).</p>
<p>Diese Notizen verfolgen ein kleines Programm durch eine lange Reihe von Neubauten, vom direkten Methodenaufruf bis zu einer ereignisgetriebenen Architektur über MQTT. Jeder Neubau lässt das Programm genau das tun, was es vorher tat, und ändert, wer von wem weiss.</p>
<p>Das gebaute Programm ändert sich nie: Sie tippen eine Zeile, sie kommt um 13 Buchstaben verschoben zurück.</p>
<pre class="text"><code>keyboard → ROT13 → console</code></pre>
<p>Was sich ändert, ist alles ringsherum. Das Tutorial baut dasselbe System immer wieder neu und stellt dabei drei Fragen, in dieser Reihenfolge:</p>
<p>Was sich ändert, ist alles ringsherum. Dasselbe System wird immer wieder neu gebaut, und jeder Neubau stellt drei Fragen, in dieser Reihenfolge:</p>
<blockquote class="blockquote">
<p><strong>Wer kennt wen?</strong></p>
<p><strong>Wer besitzt was?</strong></p>
<p><strong>Wer entscheidet, wie das System verdrahtet ist?</strong></p>
</blockquote>
<p>Jedes Mal, wenn ein Schritt fertig ist, kommt hier eine Zusammenfassung hinzu; das Buch wächst also im Tempo der Arbeit. Jede Zusammenfassung sagt, was der Schritt getan hat, was beim Ausführen beobachtet wurde und was sich architektonisch verschoben hat — meist ein Stück Wissen, das den Besitzer gewechselt hat.</p>
<p><em>Nach Material von Reto Konig, Universität Freiburg.</em></p>
<section id="sec-diagrams" class="level2">
<h2 class="anchored" data-anchor-id="sec-diagrams">Wie die Abbildungen zu lesen sind</h2>
<p>Jede Abbildung existiert einmal als Zeichnung und dreimal als Sprache. In der Webfassung hat eine Abbildung mit Nachrichtenfluss eine kleine Leiste darunter: <strong>Abspielen</strong> schickt eine Nachricht durch die ganze Kette, <strong>Ein Sprung</strong> rückt einen einzigen Schritt vor, <strong>Zurücksetzen</strong> stellt alles zurück. Kästen leuchten auf, wenn die Nachricht sie erreicht; so ist zu sehen, welche Komponente wartet und welche arbeitet.</p>
<p>Im PDF und in einem Browser ohne JavaScript ist dasselbe Bild da — nur unbewegt. Nichts in diesen Notizen hängt von der Animation ab.</p>
</section>
<section id="sec-build" class="level2">
<h2 class="anchored" data-anchor-id="sec-build">Dieses Buch bauen</h2>
<p>Die drei Bücher entstehen aus einer einzigen Quelle:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./render-all.sh</span> <span class="co"># Abbildungen, dann html + pdf für en, fr, de</span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./render-all.sh</span> <span class="at">--serve</span> <span class="co"># …und _book/ auf http://localhost:8000 ausliefern</span></span></code></pre></div><button title="In die Zwischenablage kopieren" class="code-copy-button"><i class="bi"></i></button></div>
<p><code>_book/</code> enthält das englische Buch, <code>_book/fr/</code> das französische und <code>_book/de/</code> das deutsche; das Sprachmenü in der Seitenleiste wechselt zwischen ihnen und merkt sich die Wahl. Ein einfaches <code>quarto render</code> baut nur Englisch und leert <code>_book/</code>, was die anderen zwei entfernt — also das Skript benutzen.</p>
</section>
@@ -1052,8 +1073,8 @@ Mediator.java, .msg, put/take, Intent/Status/Event).
<div class="nav-page nav-page-previous">
</div>
<div class="nav-page nav-page-next">
<a href="./00-orientation.html" class="pagination-link" aria-label="[Step 0 — What the tutorial is about]{.en}[Étape 0 — De quoi parle le tutoriel]{.fr}[Schritt 0 — Worum es im Tutorial geht]{.de}">
<span class="nav-page-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Schritt 0 — Worum es im Tutorial geht</span></span> <i class="bi bi-arrow-right-short"></i>
<a href="./00-orientation.html" class="pagination-link" aria-label="[Step 0 — What this is about]{.en}[Étape 0 — De quoi il s'agit]{.fr}[Schritt 0 — Worum es geht]{.de}">
<span class="nav-page-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Schritt 0 — Worum es geht</span></span> <i class="bi bi-arrow-right-short"></i>
</a>
</div>
</nav>
+31 -30
View File
@@ -2,9 +2,9 @@
{
"objectID": "index.html",
"href": "index.html",
"title": "Vom Aufruf zum Ereignis",
"title": "Prozesssteuerung",
"section": "",
"text": "Über diese Notizen\nDiese Notizen fassen das Tutorial „SIN.04028 — From Calling to Eventing“ zusammen, Schritt für Schritt durchgearbeitet. Das Tutorial selbst liegt neben diesem Buch, in SIN.04028-From-Calling-to-Eventing/README.md, und gehört zur Vorlesung Process Control von Reto Konig an der Universität Freiburg (Herbstsemester 2026).\nDas gebaute Programm ändert sich nie: Sie tippen eine Zeile, sie kommt um 13 Buchstaben verschoben zurück.\nWas sich ändert, ist alles ringsherum. Das Tutorial baut dasselbe System immer wieder neu und stellt dabei drei Fragen, in dieser Reihenfolge:\nJedes Mal, wenn ein Schritt fertig ist, kommt hier eine Zusammenfassung hinzu; das Buch wächst also im Tempo der Arbeit. Jede Zusammenfassung sagt, was der Schritt getan hat, was beim Ausführen beobachtet wurde und was sich architektonisch verschoben hat — meist ein Stück Wissen, das den Besitzer gewechselt hat.",
"text": "Über diese Notizen\nDiese Notizen verfolgen ein kleines Programm durch eine lange Reihe von Neubauten, vom direkten Methodenaufruf bis zu einer ereignisgetriebenen Architektur über MQTT. Jeder Neubau lässt das Programm genau das tun, was es vorher tat, und ändert, wer von wem weiss.\nDas gebaute Programm ändert sich nie: Sie tippen eine Zeile, sie kommt um 13 Buchstaben verschoben zurück.\nWas sich ändert, ist alles ringsherum. Dasselbe System wird immer wieder neu gebaut, und jeder Neubau stellt drei Fragen, in dieser Reihenfolge:\nJedes Mal, wenn ein Schritt fertig ist, kommt hier eine Zusammenfassung hinzu; das Buch wächst also im Tempo der Arbeit. Jede Zusammenfassung sagt, was der Schritt getan hat, was beim Ausführen beobachtet wurde und was sich architektonisch verschoben hat — meist ein Stück Wissen, das den Besitzer gewechselt hat.\nNach Material von Reto Konig, Universität Freiburg.",
"crumbs": [
"[About these notes]{.en}[À propos de ces notes]{.fr}[Über diese Notizen]{.de}"
]
@@ -12,41 +12,31 @@
{
"objectID": "index.html#sec-diagrams",
"href": "index.html#sec-diagrams",
"title": "Vom Aufruf zum Ereignis",
"title": "Prozesssteuerung",
"section": "Wie die Abbildungen zu lesen sind",
"text": "Wie die Abbildungen zu lesen sind\nJede Abbildung existiert einmal als Zeichnung und dreimal als Sprache. In der Webfassung hat eine Abbildung mit Nachrichtenfluss eine kleine Leiste darunter: Abspielen schickt eine Nachricht durch die ganze Kette, Ein Sprung rückt einen einzigen Schritt vor, Zurücksetzen stellt alles zurück. Kästen leuchten auf, wenn die Nachricht sie erreicht; so ist zu sehen, welche Komponente wartet und welche arbeitet.\nIm PDF und in einem Browser ohne JavaScript ist dasselbe Bild da — nur unbewegt. Nichts in diesen Notizen hängt von der Animation ab.",
"crumbs": [
"[About these notes]{.en}[À propos de ces notes]{.fr}[Über diese Notizen]{.de}"
]
},
{
"objectID": "index.html#sec-build",
"href": "index.html#sec-build",
"title": "Vom Aufruf zum Ereignis",
"section": "Dieses Buch bauen",
"text": "Dieses Buch bauen\nDie drei Bücher entstehen aus einer einzigen Quelle:\n./render-all.sh # Abbildungen, dann html + pdf für en, fr, de\n./render-all.sh --serve # …und _book/ auf http://localhost:8000 ausliefern\n_book/ enthält das englische Buch, _book/fr/ das französische und _book/de/ das deutsche; das Sprachmenü in der Seitenleiste wechselt zwischen ihnen und merkt sich die Wahl. Ein einfaches quarto render baut nur Englisch und leert _book/, was die anderen zwei entfernt — also das Skript benutzen.",
"crumbs": [
"[About these notes]{.en}[À propos de ces notes]{.fr}[Über diese Notizen]{.de}"
]
},
{
"objectID": "00-orientation.html",
"href": "00-orientation.html",
"title": "1  Schritt 0 — Worum es im Tutorial geht",
"title": "1  Schritt 0 — Worum es geht",
"section": "",
"text": "1.1 Die drei Fragen\nSchritt 0 enthält keinen Code. Er nennt das Thema: nicht ROT13, sondern die Architektur darum herum. Die Funktionalität bleibt über 81 Schritte fast unverändert — genau das macht die Veränderungen ringsherum sichtbar.\nZwei Regeln werden hier gesetzt und gelten für das ganze Tutorial:\nDeshalb beginnt das Tutorial nicht mit MQTT und auch nicht mit dynamischen Abonnements. Es baut zuerst ein System mit absichtlich unbequemen Vermittlern, nimmt es in Betrieb und fragt erst dann, ob sie ihren Platz verdient haben.\nDie zweite Regel betrifft das Vokabular: Intent, Status/State und Event werden erst benannt, nachdem sie benutzt wurden. Sie erscheinen etwa ab Schritt 42, nicht früher.\nDie geplante Route, von Schritt 0 an:\nDer Wortlaut der drei Fragen ist wichtig, und man ersetzt ihn leicht durch eine schwächere Fassung:\n„Kennen“ ist nicht „kommunizieren“: zwei Komponenten können den ganzen Tag Nachrichten austauschen, ohne dass eine die andere nennt. „Über die Verdrahtung entscheiden“ ist nicht „verbinden“: der Teil, der Nachrichten weiterleitet, muss nicht der Teil sein, der die Route gewählt hat. Beide Unterscheidungen werden später konkret — die erste schon in Schritt 1, die zweite in Teil III.",
"text": "1.1 Die drei Fragen\nSchritt 0 enthält keinen Code. Er nennt das Thema: nicht ROT13, sondern die Architektur darum herum. Die Funktionalität bleibt über 81 Schritte fast unverändert — genau das macht die Veränderungen ringsherum sichtbar.\nZwei Regeln werden hier gesetzt und gelten bis zum Schluss:\nDeshalb beginnt der Aufbau nicht mit MQTT und auch nicht mit dynamischen Abonnements. Zuerst entsteht ein System mit absichtlich unbequemen Vermittlern, wird in Betrieb genommen, und erst dann wird gefragt, ob sie ihren Platz verdient haben.\nDie zweite Regel betrifft das Vokabular: Intent, Status/State und Event werden erst benannt, nachdem sie benutzt wurden. Sie erscheinen etwa ab Schritt 42, nicht früher.\nDie geplante Route, von Schritt 0 an:\nDer Wortlaut der drei Fragen ist wichtig, und man ersetzt ihn leicht durch eine schwächere Fassung:\n„Kennen“ ist nicht „kommunizieren“: zwei Komponenten können den ganzen Tag Nachrichten austauschen, ohne dass eine die andere nennt. „Über die Verdrahtung entscheiden“ ist nicht „verbinden“: der Teil, der Nachrichten weiterleitet, muss nicht der Teil sein, der die Route gewählt hat. Beide Unterscheidungen werden später konkret — die erste schon in Schritt 1, die zweite in Teil III.",
"crumbs": [
"<span class='chapter-number'>1</span>  <span class='chapter-title'>[Step 0 — What the tutorial is about]{.en}[Étape 0 — De quoi parle le tutoriel]{.fr}[Schritt 0 — Worum es im Tutorial geht]{.de}</span>"
"<span class='chapter-number'>1</span>  <span class='chapter-title'>[Step 0 — What this is about]{.en}[Étape 0 — De quoi il s'agit]{.fr}[Schritt 0 — Worum es geht]{.de}</span>"
]
},
{
"objectID": "00-orientation.html#sec-three-questions",
"href": "00-orientation.html#sec-three-questions",
"title": "1  Schritt 0 — Worum es im Tutorial geht",
"title": "1  Schritt 0 — Worum es geht",
"section": "",
"text": "Das Tutorial fragt\nEine schwächere Fassung\n\n\n\n\nWer kennt wen?\nwer mit wem kommuniziert\n\n\nWer besitzt was?\nwelche Daten jeder Teil hält\n\n\nWer entscheidet über die Verdrahtung?\nwelcher Teil alles verbindet",
"text": "So gefragt\nEine schwächere Fassung\n\n\n\n\nWer kennt wen?\nwer mit wem kommuniziert\n\n\nWer besitzt was?\nwelche Daten jeder Teil hält\n\n\nWer entscheidet über die Verdrahtung?\nwelcher Teil alles verbindet",
"crumbs": [
"<span class='chapter-number'>1</span>  <span class='chapter-title'>[Step 0 — What the tutorial is about]{.en}[Étape 0 — De quoi parle le tutoriel]{.fr}[Schritt 0 — Worum es im Tutorial geht]{.de}</span>"
"<span class='chapter-number'>1</span>  <span class='chapter-title'>[Step 0 — What this is about]{.en}[Étape 0 — De quoi il s'agit]{.fr}[Schritt 0 — Worum es geht]{.de}</span>"
]
},
{
@@ -74,7 +64,7 @@
"href": "01-part-i-calls.html#sec-step-2",
"title": "2  Teil I — Mit dem beginnen, was man schon kennt",
"section": "2.2 Schritt 2 — Drei egoistische Fähigkeiten",
"text": "2.2 Schritt 2 — Drei egoistische Fähigkeiten\nEine egoistische Komponente sagt: ich weiss, was ich kann, welche Daten ich annehme und welche ich erzeuge — und den Geschäftsprozess um mich herum möchte ich lieber nicht kennen. Konkret: ConsoleIn darf kein rot13(...) enthalten, und ROT13 kein consoleOut(...).\nDas Entfernen dieser Aufrufe schafft sofort ein Problem, das das Tutorial als Frage stellt: wenn niemand niemanden kennt, wer macht daraus ein System? Zu beachten ist, was die Frage nicht sagt: das Wissen ist nicht verschwunden, es muss woandershin. Es fehlen zwei Verbindungen, nicht eine — ConsoleIn ↔︎ ROT13 und ROT13 ↔︎ ConsoleOut.",
"text": "2.2 Schritt 2 — Drei egoistische Fähigkeiten\nEine egoistische Komponente sagt: ich weiss, was ich kann, welche Daten ich annehme und welche ich erzeuge — und den Geschäftsprozess um mich herum möchte ich lieber nicht kennen. Konkret: ConsoleIn darf kein rot13(...) enthalten, und ROT13 kein consoleOut(...).\nDas Entfernen dieser Aufrufe schafft sofort ein Problem, das sich als Frage stellen lässt: wenn niemand niemanden kennt, wer macht daraus ein System? Zu beachten ist, was die Frage nicht sagt: das Wissen ist nicht verschwunden, es muss woandershin. Es fehlen zwei Verbindungen, nicht eine — ConsoleIn ↔︎ ROT13 und ROT13 ↔︎ ConsoleOut.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
@@ -84,7 +74,7 @@
"href": "01-part-i-calls.html#sec-step-3",
"title": "2  Teil I — Mit dem beginnen, was man schon kennt",
"section": "2.3 Schritt 3 — Jeder Fähigkeit ein Postfach geben",
"text": "2.3 Schritt 3 — Jeder Fähigkeit ein Postfach geben\nDer kleinste Mechanismus für die fehlenden Verbindungen: eine Nachricht und eine benannte Warteschlange.\nrecord Message(String type, String value) {}\n\nMap&lt;String, BlockingQueue&lt;Message&gt;&gt; mailboxes = new ConcurrentHashMap&lt;&gt;();\n\nBlockingQueue&lt;Message&gt; mailbox(String name) {\n return mailboxes.computeIfAbsent(name, _ -&gt; new LinkedBlockingQueue&lt;&gt;());\n}\nDas Tutorial nennt diese bewusst Postfächer (mailboxes) und nicht Topics, mit Begründung: rufen zwei Leser take() auf demselben Postfach auf, konkurrieren sie — jede Nachricht geht an genau einen von ihnen und wird nicht an beide kopiert. Ein Topic in Publish/Subscribe gäbe jedem Abonnenten seine eigene Kopie. Ein Leser pro Nachricht genügt vorläufig, und die Einschränkung bleibt absichtlich bestehen: sie macht später sichtbar, was Publish/Subscribe wirklich hinzufügt.",
"text": "2.3 Schritt 3 — Jeder Fähigkeit ein Postfach geben\nDer kleinste Mechanismus für die fehlenden Verbindungen: eine Nachricht und eine benannte Warteschlange.\nrecord Message(String type, String value) {}\n\nMap&lt;String, BlockingQueue&lt;Message&gt;&gt; mailboxes = new ConcurrentHashMap&lt;&gt;();\n\nBlockingQueue&lt;Message&gt; mailbox(String name) {\n return mailboxes.computeIfAbsent(name, _ -&gt; new LinkedBlockingQueue&lt;&gt;());\n}\nDas sind bewusst Postfächer (mailboxes) und keine Topics, und der Unterschied ist wichtig: rufen zwei Leser take() auf demselben Postfach auf, konkurrieren sie — jede Nachricht geht an genau einen von ihnen und wird nicht an beide kopiert. Ein Topic in Publish/Subscribe gäbe jedem Abonnenten seine eigene Kopie. Ein Leser pro Nachricht genügt vorläufig, und die Einschränkung bleibt absichtlich bestehen: sie macht später sichtbar, was Publish/Subscribe wirklich hinzufügt.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
@@ -94,7 +84,7 @@
"href": "01-part-i-calls.html#sec-steps-4-6",
"title": "2  Teil I — Mit dem beginnen, was man schon kennt",
"section": "2.4 Schritte 4–6 — Die drei Fähigkeiten werden egoistisch",
"text": "2.4 Schritte 4–6 — Die drei Fähigkeiten werden egoistisch\nJede Fähigkeit berührt nur noch ihre eigenen Postfachnamen:\n\n\n\nFähigkeit\nliest\nschreibt\n\n\n\n\nConsoleIn\ndie Tastatur\nconsoleIn.outbox\n\n\nROT13\nrot13.inbox\nrot13.outbox\n\n\nConsoleOut\nconsoleOut.inbox\ndie Konsole\n\n\n\nKeine Fähigkeit enthält den Namen einer anderen. Die Zusammenfassung des Tutorials selbst: „drei schön isolierte Fähigkeiten. Und sie tun zusammen absolut nichts.” Nichts bewegt eine Nachricht von consoleIn.outbox nach rot13.inbox oder von rot13.outbox nach consoleOut.inbox.",
"text": "2.4 Schritte 4–6 — Die drei Fähigkeiten werden egoistisch\nJede Fähigkeit berührt nur noch ihre eigenen Postfachnamen:\n\n\n\nFähigkeit\nliest\nschreibt\n\n\n\n\nConsoleIn\ndie Tastatur\nconsoleIn.outbox\n\n\nROT13\nrot13.inbox\nrot13.outbox\n\n\nConsoleOut\nconsoleOut.inbox\ndie Konsole\n\n\n\nKeine Fähigkeit enthält den Namen einer anderen, und genau das ist das Ergebnis: drei schön isolierte Fähigkeiten, die zusammen absolut nichts tun. Nichts bewegt eine Nachricht von consoleIn.outbox nach rot13.inbox oder von rot13.outbox nach consoleOut.inbox.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
@@ -114,7 +104,7 @@
"href": "01-part-i-calls.html#sec-step-8",
"title": "2  Teil I — Mit dem beginnen, was man schon kennt",
"section": "2.6 Schritt 8 — Nochmals fragen: wer kennt wen?",
"text": "2.6 Schritt 8 — Nochmals fragen: wer kennt wen?\nKennt ConsoleIn ROT13? Nein. Kennt ROT13 ConsoleIn oder ConsoleOut? Nein. Ist die Topologie verschwunden? Nein — sie steckt in den zwei mediate(...)-Aufrufen innerhalb von main().\nDas ist das erste grosse Ergebnis des Tutorials:\n\nEntkopplung lässt Wissen oft nicht verschwinden. Sie verschiebt Wissen dorthin, wo es hingehört.\n\nDie Fähigkeit „ROT13 transformiert Text” gehört zu ROT13. Die Topologie ConsoleIn → ROT13 → ConsoleOut gehört zur Systemkomposition. Geändert hat sich seit Schritt 1 nicht, dass die Verdrahtung main() verlassen hat — sie ist noch dort —, sondern dass sie nicht mehr innerhalb einer Fähigkeit steht. Sie ist jetzt Daten: zwei Paare von Postfachnamen. Umverdrahten berührt diese zwei Zeilen und keine einzige Fähigkeit.",
"text": "2.6 Schritt 8 — Nochmals fragen: wer kennt wen?\nKennt ConsoleIn ROT13? Nein. Kennt ROT13 ConsoleIn oder ConsoleOut? Nein. Ist die Topologie verschwunden? Nein — sie steckt in den zwei mediate(...)-Aufrufen innerhalb von main().\nDas ist das erste grosse Ergebnis:\n\nEntkopplung lässt Wissen oft nicht verschwinden. Sie verschiebt Wissen dorthin, wo es hingehört.\n\nDie Fähigkeit „ROT13 transformiert Text” gehört zu ROT13. Die Topologie ConsoleIn → ROT13 → ConsoleOut gehört zur Systemkomposition. Geändert hat sich seit Schritt 1 nicht, dass die Verdrahtung main() verlassen hat — sie ist noch dort —, sondern dass sie nicht mehr innerhalb einer Fähigkeit steht. Sie ist jetzt Daten: zwei Paare von Postfachnamen. Umverdrahten berührt diese zwei Zeilen und keine einzige Fähigkeit.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
@@ -124,7 +114,7 @@
"href": "01-part-i-calls.html#sec-step-9",
"title": "2  Teil I — Mit dem beginnen, was man schon kennt",
"section": "2.7 Schritt 9 — Warum virtuelle Threads?",
"text": "2.7 Schritt 9 — Warum virtuelle Threads?\nFünf Schleifen warten nun unbegrenzt: die Tastatur, rot13.inbox, consoleOut.inbox und die Quellen der zwei Vermittler. Virtuelle Threads sind einfach der billige Java-Weg, fünf Wartevorgänge gleichzeitig in einer JVM laufen zu lassen.\nSie sind eine Implementierungsbequemlichkeit, keine Architektur. Die Architektur — wer wen kennt und wo die Verdrahtung liegt — steckt in den Postfachnamen, nicht in den Threads. Der Beleg des Tutorials für die Trennung: dieselbe Architektur läuft in Schritt 11 als getrennte Prozesse, ohne geteilte Threads zwischen den Teilen.",
"text": "2.7 Schritt 9 — Warum virtuelle Threads?\nFünf Schleifen warten nun unbegrenzt: die Tastatur, rot13.inbox, consoleOut.inbox und die Quellen der zwei Vermittler. Virtuelle Threads sind einfach der billige Java-Weg, fünf Wartevorgänge gleichzeitig in einer JVM laufen zu lassen.\nSie sind eine Implementierungsbequemlichkeit, keine Architektur. Die Architektur — wer wen kennt und wo die Verdrahtung liegt — steckt in den Postfachnamen, nicht in den Threads. Der Beleg für die Trennung: dieselbe Architektur läuft in Schritt 11 als getrennte Prozesse, ohne geteilte Threads zwischen den Teilen.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
@@ -134,7 +124,7 @@
"href": "01-part-i-calls.html#sec-step-10",
"title": "2  Teil I — Mit dem beginnen, was man schon kennt",
"section": "2.8 Schritt 10 — Die Dienste egoistisch halten",
"text": "2.8 Schritt 10 — Die Dienste egoistisch halten\nDie naheliegende Abkürzung: der erste Vermittler kopiert Nachrichten nur unverändert — warum ihn also nicht löschen und ROT13 direkt take() auf consoleIn.outbox machen lassen?\nWeil ROT13 dann den Namen consoleIn.outbox enthielte, also wüsste, dass ConsoleIn existiert und wohin es veröffentlicht. Die Topologie wanderte in ROT13 hinein, und ROT13 wäre keine egoistische Fähigkeit mehr. Der Test, der das konkret macht: die Eingabe komme künftig von einer neuen Fähigkeit FileIn, die in fileIn.outbox veröffentlicht.\n\n\n\n\n\n\n\n\n\nmit Vermittler\nmit der Abkürzung\n\n\n\n\nwas sich ändert\nein Argument des Vermittlers\nrunRot13 selbst\n\n\nwer berührt wird\nkeine Fähigkeit\nROT13, dessen Aufgabe unverändert blieb\n\n\n\nDas Tutorial ist ehrlich über den Preis: dieses Design „mag indirekt wirken — sogar etwas eigenartig”, und es verspricht einen anderen Weg, Dienste egoistisch zu halten, ohne Vermittler im Pfad jeder Nachricht.",
"text": "2.8 Schritt 10 — Die Dienste egoistisch halten\nDie naheliegende Abkürzung: der erste Vermittler kopiert Nachrichten nur unverändert — warum ihn also nicht löschen und ROT13 direkt take() auf consoleIn.outbox machen lassen?\nWeil ROT13 dann den Namen consoleIn.outbox enthielte, also wüsste, dass ConsoleIn existiert und wohin es veröffentlicht. Die Topologie wanderte in ROT13 hinein, und ROT13 wäre keine egoistische Fähigkeit mehr. Der Test, der das konkret macht: die Eingabe komme künftig von einer neuen Fähigkeit FileIn, die in fileIn.outbox veröffentlicht.\n\n\n\n\n\n\n\n\n\nmit Vermittler\nmit der Abkürzung\n\n\n\n\nwas sich ändert\nein Argument des Vermittlers\nrunRot13 selbst\n\n\nwer berührt wird\nkeine Fähigkeit\nROT13, dessen Aufgabe unverändert blieb\n\n\n\nDer Preis gehört klar gesagt: dieses Design mag indirekt wirken — sogar etwas eigenartig. Es gibt einen anderen Weg, Dienste egoistisch zu halten, ohne Vermittler im Pfad jeder Nachricht; er kommt später.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
@@ -144,7 +134,7 @@
"href": "01-part-i-calls.html#sec-part-i-result",
"title": "2  Teil I — Mit dem beginnen, was man schon kennt",
"section": "2.9 Was Teil I verschoben hat",
"text": "2.9 Was Teil I verschoben hat\n\n\n\n\n\n\n\n\nStufe\nwo die Topologie liegt\nwer umverdrahten kann\n\n\n\n\nSchritt 1\nim Code der Fähigkeit (IO.println(rot13(text)))\nwer diesen Code ändert\n\n\nSchritte 7–8\nin main(), als Paare von Postfachnamen\nwer main() ändert\n\n\n\nFunktionalität: unverändert. Codezeilen: mehr. Teile, die einander kennen: keine. Das ist der Tauschhandel, den das restliche Tutorial immer wieder prüft.",
"text": "2.9 Was Teil I verschoben hat\n\n\n\n\n\n\n\n\nStufe\nwo die Topologie liegt\nwer umverdrahten kann\n\n\n\n\nSchritt 1\nim Code der Fähigkeit (IO.println(rot13(text)))\nwer diesen Code ändert\n\n\nSchritte 7–8\nin main(), als Paare von Postfachnamen\nwer main() ändert\n\n\n\nFunktionalität: unverändert. Codezeilen: mehr. Teile, die einander kennen: keine. Das ist der Tauschhandel, den alles Folgende immer wieder prüft.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
@@ -154,7 +144,7 @@
"href": "02-part-ii-processes.html",
"title": "3  Teil II — Die Prozessgrenze überschreiten",
"section": "",
"text": "3.1 Schritt 11 — Die Komponenten trennen\nDie Schritte 11 bis 18 nehmen die Architektur aus Teil I und verteilen sie auf fünf Betriebssystemprozesse auf einem Rechner. Die Fähigkeiten behalten ihre Postfachnamen; nur der Transport darunter wechselt, von Java-Objekten zu Dateien in Verzeichnissen. Das erste wirklich verteilte Problem tritt hier auf, und es hat nichts mit ROT13 zu tun.\nDrei Prozesse können keine BlockingQueue teilen: jeder java-Befehl startet seine eigene JVM mit eigenem Speicher, die mailboxes-Map existierte also dreimal, und jede Kopie sähe nur ihre eigenen Nachrichten. Ein externer Transport ist nötig.\nTCP würde gehen, MQTT würde gehen. Das Tutorial wählt absichtlich die primitivste Möglichkeit, das Dateisystem, mit einer einzeiligen Begründung: weil man es sehen kann. Nachrichten werden Dateien, die man mit ls auflisten und mit cat lesen kann, während das System läuft. Primitiv heisst hier nicht schlechter; Teil VIII kommt darauf zurück, was das Dateisystem wirklich gut und wirklich schlecht kann.",
"text": "3.1 Schritt 11 — Die Komponenten trennen\nDie Schritte 11 bis 18 nehmen die Architektur aus Teil I und verteilen sie auf fünf Betriebssystemprozesse auf einem Rechner. Die Fähigkeiten behalten ihre Postfachnamen; nur der Transport darunter wechselt, von Java-Objekten zu Dateien in Verzeichnissen. Das erste wirklich verteilte Problem tritt hier auf, und es hat nichts mit ROT13 zu tun.\nDrei Prozesse können keine BlockingQueue teilen: jeder java-Befehl startet seine eigene JVM mit eigenem Speicher, die mailboxes-Map existierte also dreimal, und jede Kopie sähe nur ihre eigenen Nachrichten. Ein externer Transport ist nötig.\nTCP würde gehen, MQTT würde gehen. Absichtlich fällt die Wahl auf die primitivste Möglichkeit, das Dateisystem, mit einer einzeiligen Begründung: weil man es sehen kann. Nachrichten werden Dateien, die man mit ls auflisten und mit cat lesen kann, während das System läuft. Primitiv heisst hier nicht schlechter; Teil VIII kommt darauf zurück, was das Dateisystem wirklich gut und wirklich schlecht kann.",
"crumbs": [
"<span class='chapter-number'>3</span>  <span class='chapter-title'>[Part II — Cross the process boundary]{.en}[Partie II — Franchir la frontière de processus]{.fr}[Teil II — Die Prozessgrenze überschreiten]{.de}</span>"
]
@@ -184,7 +174,7 @@
"href": "02-part-ii-processes.html#sec-step-15",
"title": "3  Teil II — Die Prozessgrenze überschreiten",
"section": "3.4 Schritt 15 — Ein Postfach mit WatchService beobachten",
"text": "3.4 Schritt 15 — Ein Postfach mit WatchService beobachten\nJavas eigener Dateisystem-Beobachter liefert die Konsumentenhälfte: ein Verzeichnis für ENTRY_CREATE registrieren, in watcher.take() blockieren und jeden Dateinamen ignorieren, der nicht auf .msg endet.\nDas ergibt auch ein sehr einfaches Einspeisewerkzeug. Mit ActuatorService als laufendem Konsumenten:\nprintf 'TEXT\\nHello from a file' &gt; messageBoard/consoleOut/inbox/manual.tmp\nmv messageBoard/consoleOut/inbox/manual.tmp messageBoard/consoleOut/inbox/manual.msg\nBeobachtet: beim Auftauchen der .tmp-Datei geschieht nichts; die Zeile erscheint in dem Moment, in dem das Umbenennen den .msg-Namen erzeugt. Beide erlaubten Formate funktionieren, mit und ohne abschliessenden Zeitstempel.\nDie architektonische Lehre ist die, die das Tutorial als producer → filesystem → consumer zieht: der Konsument konnte einen Menschen, der mv tippt, nicht von einem echten Dienst unterscheiden. Er kennt sein eigenes Eingangspostfach, nicht den, der hineinschreibt. Der Egoismus hat die Prozessgrenze überlebt.",
"text": "3.4 Schritt 15 — Ein Postfach mit WatchService beobachten\nJavas eigener Dateisystem-Beobachter liefert die Konsumentenhälfte: ein Verzeichnis für ENTRY_CREATE registrieren, in watcher.take() blockieren und jeden Dateinamen ignorieren, der nicht auf .msg endet.\nDas ergibt auch ein sehr einfaches Einspeisewerkzeug. Mit ActuatorService als laufendem Konsumenten:\nprintf 'TEXT\\nHello from a file' &gt; messageBoard/consoleOut/inbox/manual.tmp\nmv messageBoard/consoleOut/inbox/manual.tmp messageBoard/consoleOut/inbox/manual.msg\nBeobachtet: beim Auftauchen der .tmp-Datei geschieht nichts; die Zeile erscheint in dem Moment, in dem das Umbenennen den .msg-Namen erzeugt. Beide erlaubten Formate funktionieren, mit und ohne abschliessenden Zeitstempel.\nDie architektonische Lehre lautet producer → filesystem → consumer: der Konsument konnte einen Menschen, der mv tippt, nicht von einem echten Dienst unterscheiden. Er kennt sein eigenes Eingangspostfach, nicht den, der hineinschreibt. Der Egoismus hat die Prozessgrenze überlebt.",
"crumbs": [
"<span class='chapter-number'>3</span>  <span class='chapter-title'>[Part II — Cross the process boundary]{.en}[Partie II — Franchir la frontière de processus]{.fr}[Teil II — Die Prozessgrenze überschreiten]{.de}</span>"
]
@@ -194,7 +184,7 @@
"href": "02-part-ii-processes.html#sec-steps-16-17",
"title": "3  Teil II — Die Prozessgrenze überschreiten",
"section": "3.5 Schritte 16–17 — Dienste und Vermittler werden Prozesse",
"text": "3.5 Schritte 16–17 — Dienste und Vermittler werden Prozesse\nDie drei Fähigkeiten werden drei Programme, und der Vermittler eine vierte Art Programm:\n\n\n\n\n\n\n\n\n\nProgramm\nspielt\nliest\nschreibt\n\n\n\n\nSensorService.java\nConsoleIn\ndie Tastatur\nconsoleIn/outbox\n\n\nProcessorService.java\nROT13\nrot13/inbox\nrot13/outbox\n\n\nActuatorService.java\nConsoleOut\nconsoleOut/inbox\ndie Konsole\n\n\nMediator.java &lt;from&gt; &lt;to&gt;\nder Klebstoff\n&lt;from&gt;\n&lt;to&gt;\n\n\n\nDer Vermittler ist generisch: seine Route ist nicht einkompiliert, sie kommt als zwei Startargumente. Doch das Tutorial weist auf eine Asymmetrie hin, die man im Kopf behalten sollte: die drei Fähigkeiten erhalten ihre Arbeit als Nachrichten in einem Postfach, der Vermittler dagegen seine Route als Startkonfiguration — und er hat keinen Namen und kein eigenes Steuerpostfach, in das jemand schreiben könnte.\nPraktische Folge: Argumente werden einmal gelesen, das Ändern der Route eines laufenden Vermittlers heisst also: anhalten und neu starten. Eine Konfigurationsdatei wäre nicht anders — auch sie wird beim Start gelesen. Das Tutorial lässt diesen Punkt absichtlich offen, bis die Kosten der verteilten Vermittler zu spüren waren.",
"text": "3.5 Schritte 16–17 — Dienste und Vermittler werden Prozesse\nDie drei Fähigkeiten werden drei Programme, und der Vermittler eine vierte Art Programm:\n\n\n\n\n\n\n\n\n\nProgramm\nspielt\nliest\nschreibt\n\n\n\n\nSensorService.java\nConsoleIn\ndie Tastatur\nconsoleIn/outbox\n\n\nProcessorService.java\nROT13\nrot13/inbox\nrot13/outbox\n\n\nActuatorService.java\nConsoleOut\nconsoleOut/inbox\ndie Konsole\n\n\nMediator.java &lt;from&gt; &lt;to&gt;\nder Klebstoff\n&lt;from&gt;\n&lt;to&gt;\n\n\n\nDer Vermittler ist generisch: seine Route ist nicht einkompiliert, sie kommt als zwei Startargumente. Doch eine Asymmetrie sollte man im Kopf behalten: die drei Fähigkeiten erhalten ihre Arbeit als Nachrichten in einem Postfach, der Vermittler dagegen seine Route als Startkonfiguration — und er hat keinen Namen und kein eigenes Steuerpostfach, in das jemand schreiben könnte.\nPraktische Folge: Argumente werden einmal gelesen, das Ändern der Route eines laufenden Vermittlers heisst also: anhalten und neu starten. Eine Konfigurationsdatei wäre nicht anders — auch sie wird beim Start gelesen. Dieser Punkt bleibt absichtlich offen, bis die Kosten der verteilten Vermittler zu spüren waren.",
"crumbs": [
"<span class='chapter-number'>3</span>  <span class='chapter-title'>[Part II — Cross the process boundary]{.en}[Partie II — Franchir la frontière de processus]{.fr}[Teil II — Die Prozessgrenze überschreiten]{.de}</span>"
]
@@ -204,7 +194,7 @@
"href": "02-part-ii-processes.html#sec-step-18",
"title": "3  Teil II — Die Prozessgrenze überschreiten",
"section": "3.6 Schritt 18 — Die vollständig externe lokale Fassung ausführen",
"text": "3.6 Schritt 18 — Die vollständig externe lokale Fassung ausführen\nFünf Terminals, fünf Prozesse, ein lokales Dateisystem dazwischen:\njava SensorService.java # terminal 1\njava Mediator.java consoleIn/outbox rot13/inbox # terminal 2\njava ProcessorService.java # terminal 3\njava Mediator.java rot13/outbox consoleOut/inbox # terminal 4\njava ActuatorService.java # terminal 5\nBeobachtet: Hello World, in Terminal 1 getippt, erschien als Uryyb Jbeyq in Terminal 5. Die drei mittleren Terminals zeigten nichts Neues — jeder Vermittler gibt beim Start eine Zeile „Mediating: …” aus, und ProcessorService gibt überhaupt nichts aus. Danach enthielt jedes der vier Postfachverzeichnisse eine .msg-Datei: dieselbe Zeile, entlang der Kette kopiert.\nNachzählen: fünf Prozesse für das, was Schritt 1 in einer Anweisung tat. Die Anweisung des Tutorials an dieser Stelle lautet nicht, zu optimieren: „We are not done making it painful.”\n\n\n\n\n\n\nAbbildung 3.1: Die fünf Prozesse und die vier Postfachverzeichnisse. In der Webfassung folgt Abspielen einer Textzeile von der Tastatur zur Konsole.",
"text": "3.6 Schritt 18 — Die vollständig externe lokale Fassung ausführen\nFünf Terminals, fünf Prozesse, ein lokales Dateisystem dazwischen:\njava SensorService.java # terminal 1\njava Mediator.java consoleIn/outbox rot13/inbox # terminal 2\njava ProcessorService.java # terminal 3\njava Mediator.java rot13/outbox consoleOut/inbox # terminal 4\njava ActuatorService.java # terminal 5\nBeobachtet: Hello World, in Terminal 1 getippt, erschien als Uryyb Jbeyq in Terminal 5. Die drei mittleren Terminals zeigten nichts Neues — jeder Vermittler gibt beim Start eine Zeile „Mediating: …” aus, und ProcessorService gibt überhaupt nichts aus. Danach enthielt jedes der vier Postfachverzeichnisse eine .msg-Datei: dieselbe Zeile, entlang der Kette kopiert.\nNachzählen: fünf Prozesse für das, was Schritt 1 in einer Anweisung tat. Jetzt ist nicht der Moment zu optimieren: bequem soll es noch nicht sein.\n\n\n\n\n\n\nAbbildung 3.1: Die fünf Prozesse und die vier Postfachverzeichnisse. In der Webfassung folgt Abspielen einer Textzeile von der Tastatur zur Konsole.",
"crumbs": [
"<span class='chapter-number'>3</span>  <span class='chapter-title'>[Part II — Cross the process boundary]{.en}[Partie II — Franchir la frontière de processus]{.fr}[Teil II — Die Prozessgrenze überschreiten]{.de}</span>"
]
@@ -218,5 +208,16 @@
"crumbs": [
"<span class='chapter-number'>3</span>  <span class='chapter-title'>[Part II — Cross the process boundary]{.en}[Partie II — Franchir la frontière de processus]{.fr}[Teil II — Die Prozessgrenze überschreiten]{.de}</span>"
]
},
{
"objectID": "glossary.html",
"href": "glossary.html",
"title": "Glossar",
"section": "",
"text": "Jeder Begriff unten wird dort definiert, wo er zum ersten Mal gebraucht wird, und von jeder späteren Erwähnung aus verlinkt. Der Pfeil eines Eintrags führt dorthin zurück.",
"crumbs": [
"Anhang",
"[Glossary]{.en}[Glossaire]{.fr}[Glossar]{.de}"
]
}
]
@@ -0,0 +1,34 @@
/* further — "to go further" notes: optional material, set apart in purple */
.further {
margin: 1.1rem 0;
padding: 0.5rem 0.9rem 0.6rem;
border: 1px solid color-mix(in srgb, var(--calc-furthercolor, #6B3FA0) 30%, transparent);
border-left: 3px solid var(--calc-furthercolor, #6B3FA0);
border-radius: 0.35rem;
background: color-mix(in srgb, var(--calc-furthercolor, #6B3FA0) 4%, transparent);
}
.further-head {
color: var(--calc-furthercolor, #6B3FA0);
font-weight: 600;
font-size: 0.92em;
margin-bottom: 0.35rem;
}
.further-body > p:first-child { margin-top: 0; }
.further-body > p:last-child { margin-bottom: 0; }
/* keep wide content inside the box, as .calc and .exo do */
.further mjx-container[display="true"],
.further .katex-display {
max-width: 100%;
overflow-x: auto;
overflow-y: hidden;
padding-bottom: 0.35em;
display: flex;
justify-content: center;
justify-content: safe center;
}
.further :is(pre, table) { max-width: 100%; overflow-x: auto; }
.further img, .further svg { max-width: 100%; }
@@ -32,9 +32,9 @@ mjx-container a {
padding: 0.5rem 0.75rem;
border: 1px solid var(--calc-notecolor, #B45309);
border-radius: 0.4rem;
background: var(--bs-body-bg, #fff);
background: var(--calc-surface, #fff);
color: var(--bs-body-color, #1a1a1a);
box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
box-shadow: 0 4px 14px var(--calc-shadow, rgba(0, 0, 0, 0.15));
font-size: 0.9em;
line-height: 1.4;
}
@@ -98,3 +98,18 @@
.calc-full { grid-column: 1 / 3; }
.calc-tag { grid-column: 1 / -1; }
}
/* --- interactive figures ------------------------------------------------
A figure that is dragged — a rotatable 3d view, a point moved with the
mouse — must not select its own labels while the pointer travels over
them: the browser would paint the axis names and captions as selected
text. The readouts and captions around the drawing stay selectable, so a
value can still be copied. The hooks are the ones every course's figure
scripts build into. */
[data-notes-fig] svg,
[data-notes-plot] svg,
[data-notes-fig] canvas,
[data-notes-plot] canvas {
-webkit-user-select: none;
user-select: none;
}
@@ -13,3 +13,58 @@
});
});
})();
// --- high contrast: a switch of its own, beside Quarto's light/dark one ----
// The class is already set before the first paint by the script calc-notes.lua
// puts in the head; this only builds the control and remembers a choice.
// Precedence: what the reader picked here, then `high-contrast: true` in the
// book, then the reader's system setting.
(function () {
var KEY = "notes-contrast";
var root = document.documentElement;
var LABELS = {
de: { on: "Hoher Kontrast aus", off: "Hoher Kontrast ein" },
fr: { on: "Désactiver le contraste élevé", off: "Activer le contraste élevé" },
en: { on: "Turn high contrast off", off: "Turn high contrast on" }
};
var lang = (root.lang || "en").slice(0, 2).toLowerCase();
var L = LABELS[lang] || LABELS.en;
function store(v) {
try { localStorage.setItem(KEY, v ? "more" : "normal"); } catch (e) {}
}
function paint() {
var on = root.classList.contains("hc");
document.querySelectorAll(".notes-contrast-toggle").forEach(function (b) {
b.setAttribute("aria-pressed", String(on));
b.setAttribute("title", on ? L.on : L.off);
b.setAttribute("aria-label", on ? L.on : L.off);
});
}
function build() {
var anchors = document.querySelectorAll(".quarto-color-scheme-toggle");
if (anchors.length === 0) return; // a page without Quarto's own tools
anchors.forEach(function (a) {
var b = document.createElement("button");
b.type = "button";
b.className = "quarto-navigation-tool px-1 notes-contrast-toggle";
// bootstrap-icons ships with these books; the glyph is the fallback
b.innerHTML = '<i class="bi bi-circle-half" aria-hidden="true"></i>';
b.addEventListener("click", function () {
var on = !root.classList.contains("hc");
root.classList.toggle("hc", on);
store(on);
paint();
});
a.parentNode.insertBefore(b, a.nextSibling);
});
paint();
}
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", build);
} else { build(); }
})();
@@ -0,0 +1,316 @@
/* high-contrast.css — the high-contrast pair, taken from GitHub's
"GitHub Light High Contrast" and "GitHub Dark High Contrast" VS Code
themes (the Primer `light_high_contrast` / `dark_high_contrast` scales).
It is switched by `hc` on <html>, which calc-notes.lua sets from
high-contrast: true
in the document metadata, and which the same in-header script sets for a
reader whose system asks for `prefers-contrast: more`. One class rather
than a class and a media query, so the palette below is written once.
It rides on top of the ordinary light/dark pair: `html.hc` restyles the
light theme, `html.hc body.quarto-dark` the night one, so the reader's own
light/dark toggle keeps working.
GitHub's two high-contrast themes separate things by outline rather than by
fill: text sits at full strength (fg.muted == fg.default), borders are
strong, and the tinted panels of the ordinary themes lose their tint. The
rules here do the same to the notes environments. */
/* ---------------------------------------------------------------- light -- */
html.hc {
/* Primer light_high_contrast */
--hc-canvas: #ffffff; /* canvas.default */
--hc-inset: #ffffff; /* canvas.inset — separation is by border */
--hc-fg: #0e1116; /* fg.default, and fg.muted, which equals it */
--hc-subtle: #66707b; /* fg.subtle — the only softened ink */
--hc-border: #20252c; /* border.default */
--hc-border-soft: #88929d; /* border.muted */
--hc-accent: #0349b4; /* accent.fg */
--hc-danger: #a0111f; /* danger.fg */
--hc-success: #055d20; /* success.fg */
--hc-attention: #4e2c00; /* attention.fg */
--hc-severe: #702c00; /* severe.fg */
--hc-done: #622cbc; /* done.fg */
/* the extension's own tokens */
--calc-ink: var(--hc-fg);
--calc-muted: var(--hc-fg);
--calc-line: var(--hc-border);
--calc-grid: var(--hc-border-soft);
--calc-accent-a: var(--hc-accent);
--calc-accent-b: var(--hc-severe);
--calc-accent-c: var(--hc-success);
--calc-danger: var(--hc-danger);
--calc-surface: var(--hc-canvas);
--calc-faint: var(--hc-border-soft);
--calc-shadow: rgba(14, 17, 22, 0.4);
--calc-domface: var(--hc-canvas);
--calc-domtop: #d8dee4;
--calc-notecolor: var(--hc-attention);
--calc-furthercolor: var(--hc-done);
/* the page itself */
--bs-body-bg: var(--hc-canvas);
--bs-body-color: var(--hc-fg);
--bs-emphasis-color: var(--hc-fg);
--bs-secondary-color: var(--hc-fg);
--bs-tertiary-color: var(--hc-subtle);
--bs-border-color: var(--hc-border);
--bs-link-color: var(--hc-accent);
--bs-link-hover-color: var(--hc-accent);
--bs-code-color: var(--hc-fg);
--bs-heading-color: var(--hc-fg);
}
/* ----------------------------------------------------------------- dark -- */
html.hc body.quarto-dark {
/* Primer dark_high_contrast, except for the canvas: the theme's own
#0a0c10 still reads as a very dark grey next to a black one, so the page
goes fully black and every other value keeps its relation to it. */
--hc-canvas: #000000; /* canvas.default is #0a0c10 upstream */
--hc-inset: #000000; /* canvas.inset */
--hc-subtle-bg: #272b33; /* canvas.subtle */
--hc-fg: #f0f3f6; /* fg.default == fg.muted */
--hc-subtle: #9ea7b3; /* fg.subtle */
--hc-border: #7a828e; /* border.default */
--hc-border-soft: #7a828e; /* border.muted — the same in this theme */
--hc-accent: #71b7ff; /* accent.fg */
--hc-danger: #ff9492; /* danger.fg */
--hc-success: #26cd4d; /* success.fg */
--hc-attention: #f0b72f; /* attention.fg */
--hc-severe: #ff803d; /* severe.fg */
--hc-done: #cb9eff; /* done.fg */
/* a stroke on near-black wants the text colour, not the border grey */
--calc-line: var(--hc-fg);
--calc-grid: var(--hc-border);
--calc-domface: var(--hc-subtle-bg);
--calc-domtop: #3d444d;
--calc-shadow: rgba(1, 4, 9, 0.8);
}
/* the tokens that only alias, so they follow whichever block is in force */
html.hc body.quarto-dark {
--calc-ink: var(--hc-fg);
--calc-muted: var(--hc-fg);
--calc-accent-a: var(--hc-accent);
--calc-accent-b: var(--hc-severe);
--calc-accent-c: var(--hc-success);
--calc-danger: var(--hc-danger);
--calc-surface: var(--hc-canvas);
--calc-faint: var(--hc-border);
--calc-notecolor: var(--hc-attention);
--calc-furthercolor: var(--hc-done);
--bs-body-bg: var(--hc-canvas);
--bs-body-color: var(--hc-fg);
--bs-emphasis-color: var(--hc-fg);
--bs-secondary-color: var(--hc-fg);
--bs-tertiary-color: var(--hc-subtle);
--bs-border-color: var(--hc-border);
--bs-link-color: var(--hc-accent);
--bs-link-hover-color: var(--hc-accent);
--bs-code-color: var(--hc-fg);
--bs-heading-color: var(--hc-fg);
}
/* --------------------------------------------------------- page chrome -- */
/* Quarto's own furniture is compiled from the bootswatch theme, so the
variables above do not reach all of it. */
html.hc body {
background-color: var(--hc-canvas);
color: var(--hc-fg);
}
html.hc :is(h1, h2, h3, h4, h5, h6, p, li, dt, dd, caption, figcaption, th, td) {
color: var(--hc-fg);
}
html.hc :is(.text-muted, .quarto-figure figcaption, figcaption.figure-caption,
.quarto-title-meta-heading, .quarto-title-meta-contents,
.callout-title-container, .footnotes) {
color: var(--hc-fg);
}
html.hc a:not(.nav-link):not(.sidebar-item-text) { color: var(--hc-accent); }
html.hc a:focus-visible,
html.hc button:focus-visible,
html.hc summary:focus-visible { outline: 2px solid var(--hc-accent); outline-offset: 2px; }
html.hc :is(#quarto-sidebar, #quarto-margin-sidebar, .sidebar, .sidebar-navigation,
#quarto-header, .navbar, .quarto-secondary-nav) {
background-color: var(--hc-canvas);
color: var(--hc-fg);
border-color: var(--hc-border);
}
html.hc :is(.sidebar-item-text, .sidebar .nav-link, nav[role="doc-toc"] a, .navbar .nav-link,
.quarto-secondary-nav .nav-link) {
color: var(--hc-fg);
opacity: 1;
}
html.hc .sidebar nav[role="doc-toc"] ul > li > a,
html.hc .sidebar-navigation .sidebar-item a,
html.hc .sidebar-navigation .sidebar-item .sidebar-item-text {
color: var(--hc-fg);
opacity: 1;
}
/* the active entry: Quarto writes its colour with !important, so this is the
one place the palette has to answer in kind */
html.hc .sidebar nav[role="doc-toc"] ul > li > a.active,
html.hc .sidebar nav[role="doc-toc"] ul > li > ul > li > a.active,
html.hc .sidebar nav[role="doc-toc"] ul > li > a:hover,
html.hc .sidebar-navigation .sidebar-item a.active,
html.hc .sidebar-navigation .sidebar-item a:hover {
color: var(--hc-accent) !important;
border-left-color: var(--hc-accent);
font-weight: 600;
}
html.hc nav[role="doc-toc"] { border-left: 1px solid var(--hc-border-soft); }
/* the breadcrumb of the collapsed header carries its own fill in both
bootswatch themes, and its ink is the weakest contrast on the page */
html.hc .breadcrumb {
background-color: var(--hc-canvas);
border: 1px solid var(--hc-border);
}
html.hc :is(.breadcrumb, .breadcrumb-item, .breadcrumb-item a, .quarto-btn-toggle) {
color: var(--hc-fg);
}
html.hc .breadcrumb-item a { color: var(--hc-accent); }
html.hc :is(hr, .quarto-title-block .quarto-title-banner, header#title-block-header) {
border-color: var(--hc-border);
}
html.hc hr { background-color: var(--hc-border); opacity: 1; }
html.hc blockquote {
border-left: 4px solid var(--hc-border);
color: var(--hc-fg);
}
html.hc :is(table, th, td) { border-color: var(--hc-border-soft); }
html.hc thead { border-bottom: 2px solid var(--hc-border); }
/* ------------------------------------------------------------- code ----- */
/* GitHub's high-contrast themes give a block an outline instead of a fill. */
html.hc :is(pre, div.sourceCode, pre.sourceCode) {
background-color: var(--hc-inset);
border: 1px solid var(--hc-border);
color: var(--hc-fg);
}
html.hc :not(pre) > code {
background-color: var(--hc-inset);
border: 1px solid var(--hc-border-soft);
border-radius: 3px;
color: var(--hc-fg);
padding: 0 0.2em;
}
html.hc code { color: var(--hc-fg); }
/* the syntax palette of the same two themes, mapped onto pandoc's classes */
html.hc code span:is(.co, .cv, .do, .an, .in) { color: var(--hc-subtle); font-style: italic; }
html.hc code span:is(.kw, .cf) { color: var(--hc-danger); }
html.hc code span:is(.st, .ch, .sc, .ss, .vs){ color: #032563; }
html.hc code span:is(.dv, .bn, .fl, .cn) { color: #023b95; }
html.hc code span:is(.fu, .ex) { color: #512598; }
html.hc code span:is(.va, .at) { color: var(--hc-severe); }
html.hc code span:is(.dt, .bu) { color: var(--hc-success); }
html.hc code span:is(.im, .pp) { color: var(--hc-severe); }
html.hc code span:is(.er, .wa, .al) { color: var(--hc-danger); font-weight: 600; }
html.hc code span:is(.op, .ot) { color: var(--hc-fg); }
html.hc body.quarto-dark code span:is(.st, .ch, .sc, .ss, .vs) { color: #addcff; }
html.hc body.quarto-dark code span:is(.dv, .bn, .fl, .cn) { color: #91cbff; }
html.hc body.quarto-dark code span:is(.fu, .ex) { color: #dbb7ff; }
html.hc body.quarto-dark code span:is(.co, .cv, .do, .an, .in) { color: #bdc4cc; }
/* ------------------------------------------- the notes environments ----- */
/* out goes the tint; the outline carries the box, at full accent strength */
html.hc :is(.exo, .further, .quiz, .gls-inline, .gls-float, .calc-note,
.exo-sol, .exo-hint, .quiz-opt) {
background: var(--hc-canvas);
}
html.hc .exo { border-color: var(--calc-notecolor); }
html.hc :is(.exo-sol, .exo-hint) { border-color: var(--calc-notecolor); }
html.hc .exo-head strong,
html.hc .exo-hint > summary { color: var(--calc-notecolor); }
html.hc .further { border-color: var(--calc-furthercolor); }
html.hc .gls-float { border-color: var(--calc-notecolor); box-shadow: 0 4px 14px var(--calc-shadow); }
html.hc :is(.gls-inline, .calc-note) { border-left-width: 4px; }
html.hc .gls-sym { text-decoration-color: var(--calc-notecolor); }
html.hc .quiz { --quiz-ok: var(--hc-success); --quiz-bad: var(--hc-danger); --quiz-ink: var(--hc-fg); }
html.hc :is(.quiz-opt.quiz-ok, .quiz-opt.quiz-bad) { background: var(--hc-canvas); }
html.hc .quiz-opt.quiz-ok { outline: 2px solid var(--hc-success); }
html.hc .quiz-opt.quiz-bad { outline: 2px solid var(--hc-danger); }
/* Quarto's own callouts, so a page does not mix outlined boxes with filled
ones; the callout keeps its colour, in its left bar and its title */
html.hc .callout {
background-color: var(--hc-canvas) !important;
border: 1px solid var(--hc-border);
}
html.hc .callout > .callout-header {
background-color: var(--hc-canvas) !important;
border-bottom: 1px solid var(--hc-border-soft);
}
html.hc :is(.callout-body, .callout-title-container, .callout-body-container p) {
color: var(--hc-fg);
}
html.hc .callout.callout-style-default > div.callout-header { font-weight: 600; }
/* Quarto's search box: its widget is not themed by the bootswatch pair, so it
stays white on a dark page unless it is told otherwise (see theme.css) */
html.hc :is(.aa-Form, .aa-InputWrapper, .aa-Panel, .aa-Item) {
background-color: var(--hc-canvas);
color: var(--hc-fg);
border-color: var(--hc-border);
}
html.hc :is(.aa-Autocomplete, .aa-DetachedFormContainer)
.aa-Form .aa-InputWrapper .aa-Input,
html.hc :is(.aa-Autocomplete, .aa-DetachedFormContainer)
.aa-Form .aa-InputWrapperSuffix .aa-ClearButton,
html.hc :is(.aa-Autocomplete, .aa-DetachedFormContainer)
.aa-Form .aa-InputWrapperPrefix :is(.aa-Label, .aa-LoadingIndicator) svg {
color: var(--hc-fg);
}
html.hc :is(.aa-Autocomplete, .aa-DetachedFormContainer)
.aa-Form .aa-InputWrapper .aa-Input::placeholder {
color: var(--hc-fg);
opacity: 0.75;
}
/* the results panel: Quarto colours the cards through an id, so this does too */
html.hc :is(.aa-DetachedOverlay, #quarto-search-results) li.aa-Item .search-item,
html.hc :is(.aa-DetachedOverlay, #quarto-search-results) li.aa-Item .search-item
:is(.search-result-title-container, .search-result-text-container,
.search-result-section, .search-result-text, .search-result-more) {
background-color: var(--hc-canvas);
color: var(--hc-fg);
}
html.hc :is(.aa-DetachedOverlay, #quarto-search-results) li.aa-Item[aria-selected="true"] .search-item,
html.hc :is(.aa-DetachedOverlay, #quarto-search-results) li.aa-Item[aria-selected="true"] .search-item
:is(.search-result-title-container, .search-result-text-container,
.search-result-section, .search-result-text, .search-result-more) {
background-color: var(--hc-accent);
color: var(--hc-canvas);
}
/* a hit is marked by weight and a rule, not by a block of colour */
html.hc :is(.aa-DetachedOverlay, #quarto-search-results) li.aa-Item .search-item
:is(mark.search-match, .search-match.mark) {
background-color: transparent;
color: inherit;
font-weight: 700;
text-decoration: underline;
}
/* the figure buttons of the animated schemes */
html.hc :is(.ns-btn, .nc-btn, .nd-replay) {
background: var(--hc-canvas);
color: var(--hc-fg);
border-color: var(--hc-border);
}
html.hc :is(.notes-spiral, .notes-cantor) :is(.ns-btn, .nc-btn)[aria-pressed="true"] {
background: var(--hc-canvas);
border-color: var(--hc-accent);
color: var(--hc-accent);
font-weight: 600;
}
/* the last tinted fills: a calc box and a note keep their outline instead */
html.hc :is(.calc-box, .calc-note, .calc-note[open]) { background: transparent; }
@@ -0,0 +1,50 @@
/* narrow.css — the book on a phone.
Nothing in the flow may be wider than the screen: a wide formula, table or
figure scrolls inside its own box instead of pushing the whole page
sideways (which leaves the text cut off at the left edge).
Loaded with calc-notes.css, so every page of every book gets it. */
/* --- display maths ------------------------------------------------------
The boxes of this extension (.calc, .exo, .further) already scroll their
own maths; this covers every other display formula on the page. */
:is(main, .quarto-title-block) :is(mjx-container[display="true"], .math.display) {
max-width: 100%;
overflow-x: auto;
overflow-y: hidden; /* Firefox computes phantom vertical overflow */
padding-bottom: 0.35em; /* keep descenders clear of a scrollbar */
/* a centred formula that overflows would hide its left side out of reach,
so centre it only while it fits */
justify-content: safe center;
}
/* --- everything else that can be wider than a phone ---------------------- */
main :is(pre, .sourceCode) { max-width: 100%; overflow-x: auto; }
main :is(img, svg) { max-width: 100%; height: auto; }
main table:not(.ltx-table) { display: block; max-width: 100%; overflow-x: auto; }
/* the animated figures of lesson-style chapters */
.notes-cantor, .notes-spiral, .notes-dominos { max-width: 100%; overflow-x: auto; }
/* the glossary popup: never wider than the screen */
.gls-float { max-width: min(92vw, 26rem); }
/* --- phone-sized screens ------------------------------------------------- */
@media (max-width: 575.98px) {
/* the equation number of a labelled calc block goes under the line, so the
formula keeps the full width */
.calc { grid-template-columns: max-content 1fr; }
/* figure captions and the fold summaries read better tight */
.exo, .further { padding-left: 0.6rem; padding-right: 0.6rem; }
/* A bare url in prose, or a long identifier in a code span, is one word to
the line breaker and paints past its block on a narrow screen — no
element is oversized, so only the text itself overflows. */
#quarto-document-content :is(a, code) { overflow-wrap: break-word; }
/* Quarto's own previous/next footer: the chapter titles are laid out in a
row that will not shrink, so a long title pushes the page sideways. */
.page-navigation { flex-wrap: wrap; row-gap: 0.75em; }
.nav-page, .nav-page .nav-page-text { min-width: 0; }
.nav-page .chapter-title { overflow-wrap: break-word; }
}
@@ -0,0 +1,129 @@
/* theme.css — one palette for every part of the notes extension, in light
mode, in night mode and in high contrast.
Night mode keys off Quarto's own `body.quarto-dark`, which the light/dark
toggle sets — never off `prefers-color-scheme`, so a book configured
light-only stays light for a reader whose system is dark.
A book opts in with, in _quarto.yml:
format:
html:
theme:
light: [cosmo]
dark: [darkly]
High contrast is a separate sheet, high-contrast.css, after GitHub's two
high-contrast VS Code themes. It keys off `hc` on <html>, which
calc-notes.lua sets from `high-contrast: true` in the metadata and for a
reader whose system asks for `prefers-contrast: more`.
Loaded with calc-notes.css, so every page of every book has these tokens. */
:root {
--calc-ink: #1a1a1a; /* figure text, strong strokes */
--calc-muted: #57606a; /* captions, readouts, button text */
--calc-line: #444444; /* axes and rules */
--calc-grid: #cccccc; /* lattice dots, faint grid */
--calc-accent-a: #1F6FB4; /* lineA of the tikz preamble */
--calc-accent-b: #D1541F; /* lineB */
--calc-accent-c: #2E8B57; /* lineC */
--calc-danger: #B91C1C; /* an error state, e.g. a failed code run */
--calc-surface: var(--bs-body-bg, #ffffff);
--calc-faint: #e7e9ec; /* hairlines between rows */
--calc-shadow: rgba(0, 0, 0, 0.15); /* floats above the page */
--calc-domface: #DCE7F2; /* the domino figure's front face */
--calc-domtop: #B8CFE4; /* its top face */
/* --calc-notecolor-src and --calc-furthercolor-src come from the document
metadata (calc-notes.lua / further.lua) and are the book's own colours;
--calc-notecolor and --calc-furthercolor are what everything draws with,
and equal the source here. The dark block lifts them. */
}
body.quarto-dark {
--calc-ink: #e6e9ed;
--calc-muted: #9aa4b2;
--calc-line: #b6bec7;
--calc-grid: #4b535d;
--calc-accent-a: #6fb0ea;
--calc-accent-b: #f0956a;
--calc-accent-c: #64c49a;
--calc-danger: #f08a8a;
--calc-faint: #3a4049;
--calc-shadow: rgba(0, 0, 0, 0.55);
--calc-domface: #2b3b4d;
--calc-domtop: #365070;
/* The book's own accent is kept, not replaced: its print value is too dim
on a dark ground, so it is lifted to a light tone at the same hue rather
than swapped for a generic amber. A book that wants a specific night
value sets `notecolor-dark:` / `furthercolor-dark:` in its metadata.
On a browser without relative colour syntax the lift is dropped and the
book's own colour is used unchanged. */
--calc-notecolor:
var(--calc-notecolor-dark,
oklch(from var(--calc-notecolor-src, #B45309) 0.78 c h));
--calc-furthercolor:
var(--calc-furthercolor-dark,
oklch(from var(--calc-furthercolor-src, #6B3FA0) 0.80 c h));
}
/* --- generated line art -------------------------------------------------
The tikz figures are black-and-colour line drawings on transparent white.
Inverting them keeps the drawing readable and, with the hue rotation,
keeps blue blue and orange orange. Photographs live under img/ and are
left alone; an svg that is a photograph, or that carries its own dark
palette, opts out with class="no-invert". */
body.quarto-dark main img[src$=".svg"]:not(.no-invert) {
filter: invert(1) hue-rotate(180deg);
}
/* --- higher contrast ---------------------------------------------------
The high-contrast pair lives in high-contrast.css, which is loaded with
this file and keys off `hc` on <html>. */
/* --- Quarto's search box -------------------------------------------------
The search widget keeps its own white surface whatever the bootswatch
theme says, so on a dark page it is a white slab with dark text. It is
given the page's own surface here rather than in each book. */
body.quarto-dark :is(.aa-Form, .aa-InputWrapper, .aa-Panel, .aa-Item,
.aa-DetachedContainer, .aa-DetachedFormContainer) {
background-color: var(--calc-surface, #222);
color: var(--calc-ink, #e6e9ed);
border-color: var(--calc-faint, #3a4049);
}
/* The ink inside the form is a separate problem from its surface: Quarto's
dark bundle sets the input, its placeholder, the clear button and the
magnifier to rgb(45,45,45) through a four-class selector, so a short one
loses the cascade and the typed text stays unreadable. The shape below
matches Quarto's own, which is the only way to win without !important. */
body.quarto-dark :is(.aa-Autocomplete, .aa-DetachedFormContainer)
.aa-Form .aa-InputWrapper .aa-Input,
body.quarto-dark :is(.aa-Autocomplete, .aa-DetachedFormContainer)
.aa-Form .aa-InputWrapperSuffix .aa-ClearButton,
body.quarto-dark :is(.aa-Autocomplete, .aa-DetachedFormContainer)
.aa-Form .aa-InputWrapperPrefix :is(.aa-Label, .aa-LoadingIndicator) svg {
color: var(--calc-ink, #e6e9ed);
}
body.quarto-dark :is(.aa-Autocomplete, .aa-DetachedFormContainer)
.aa-Form .aa-InputWrapper .aa-Input::placeholder {
color: var(--calc-muted, #9aa4b2);
}
/* --- the high-contrast switch -------------------------------------------
Built by calc-notes.js next to Quarto's light/dark toggle, and styled to
sit with it rather than stand out. */
.notes-contrast-toggle {
background: none;
border: 0;
color: inherit;
line-height: 1;
cursor: pointer;
opacity: 0.85;
}
.notes-contrast-toggle:hover { opacity: 1; }
.notes-contrast-toggle[aria-pressed="true"] {
opacity: 1;
color: var(--calc-accent-a, #1F6FB4);
}
.notes-contrast-toggle:focus-visible {
outline: 2px solid var(--calc-accent-a, #1F6FB4);
outline-offset: 2px;
}
@@ -0,0 +1,178 @@
/* quiz — tick-box self-checks: options, per-option explanations, score bar
*
* The card borrows .exo's frame so a quiz and an exercise look related.
* Green and red are reserved for the verdict: nothing else on the page uses
* them, so a colour here always means "this answer was judged".
*/
.quiz {
--quiz-ok: #1a7f5a;
--quiz-bad: #a3324a;
--quiz-ink: #5a6879;
margin: 1.4rem 0;
padding: 0.7rem 1rem 0.85rem;
border: 1px solid color-mix(in srgb, var(--calc-notecolor, #B45309) 35%, transparent);
border-left: 3px solid var(--calc-notecolor, #B45309);
border-radius: 0.35rem;
scroll-margin-top: 5rem;
}
/* keep wide content inside the card, as in .calc and .exo */
.quiz mjx-container[display="true"],
.quiz .katex-display {
max-width: 100%;
overflow-x: auto;
overflow-y: hidden;
padding-bottom: 0.35em;
display: flex;
justify-content: center;
justify-content: safe center;
}
.quiz .math.display { display: block; max-width: 100%; }
.quiz :is(pre, table) { max-width: 100%; overflow-x: auto; }
.quiz img, .quiz svg { max-width: 100%; }
.quiz-head { margin: 0 0 0.45rem; }
.quiz-head strong { color: var(--calc-notecolor, #B45309); }
.quiz-tip {
margin: 0 0 0.7rem;
font-size: 0.82rem;
color: var(--quiz-ink);
}
/* ---- questions ------------------------------------------------------ */
.quiz-q + .quiz-q {
margin-top: 1.1rem;
padding-top: 0.9rem;
border-top: 1px dashed color-mix(in srgb, var(--calc-notecolor, #B45309) 30%, transparent);
}
.quiz-q-head { margin: 0 0 0.35rem; font-size: 0.9em; }
/* ---- options -------------------------------------------------------- */
.quiz-opts {
list-style: none;
margin: 0.55rem 0 0;
padding: 0;
}
.quiz-opt {
margin: 0;
padding: 0.22rem 0.4rem;
border-radius: 0.25rem;
border-left: 2px solid transparent;
}
.quiz-opt + .quiz-opt { margin-top: 0.15rem; }
/* the whole row is the click target, so a long formula is still easy to tick */
.quiz-label {
display: flex;
align-items: baseline;
gap: 0.55rem;
cursor: pointer;
}
.quiz-box {
flex: 0 0 auto;
width: 1rem;
height: 1rem;
margin: 0;
/* baseline-align the box with the first line of the option text */
transform: translateY(0.15rem);
accent-color: var(--calc-notecolor, #B45309);
cursor: pointer;
}
.quiz-opt-text { min-width: 0; }
.quiz-opt-text > :first-child { margin-top: 0; }
.quiz-opt-text > :last-child { margin-bottom: 0; }
/* judged options */
.quiz-opt.quiz-ok {
background: color-mix(in srgb, var(--quiz-ok) 8%, transparent);
border-left-color: var(--quiz-ok);
}
.quiz-opt.quiz-bad {
background: color-mix(in srgb, var(--quiz-bad) 8%, transparent);
border-left-color: var(--quiz-bad);
}
/* ---- explanations --------------------------------------------------- */
.quiz-why {
margin: 0.35rem 0 0.15rem 1.55rem;
padding: 0.3rem 0 0.3rem 0.7rem;
border-left: 2px solid var(--quiz-bad);
font-size: 0.88rem;
}
.quiz-why > :first-child { margin-top: 0; }
.quiz-why > :last-child { margin-bottom: 0; }
.quiz-why-q {
margin-left: 0;
margin-top: 0.5rem;
}
/* ---- verdict and bar ------------------------------------------------ */
.quiz-verdict {
margin: 0.5rem 0 0;
font-size: 0.85rem;
font-weight: 600;
}
.quiz-verdict.quiz-ok { color: var(--quiz-ok); }
.quiz-verdict.quiz-bad { color: var(--quiz-bad); }
.quiz-bar {
display: flex;
align-items: center;
gap: 0.6rem;
flex-wrap: wrap;
margin-top: 1rem;
padding-top: 0.7rem;
border-top: 1px solid color-mix(in srgb, var(--calc-notecolor, #B45309) 25%, transparent);
}
.quiz-bar button {
font: inherit;
font-size: 0.84rem;
padding: 0.2rem 0.85rem;
cursor: pointer;
border: 1px solid color-mix(in srgb, var(--calc-notecolor, #B45309) 45%, transparent);
border-radius: 999px;
background: transparent;
color: var(--calc-notecolor, #B45309);
}
.quiz-bar button:hover {
background: color-mix(in srgb, var(--calc-notecolor, #B45309) 10%, transparent);
}
.quiz-bar button.quiz-reset {
border-color: color-mix(in srgb, var(--quiz-ink) 40%, transparent);
color: var(--quiz-ink);
}
.quiz-bar button.quiz-reset:hover {
background: color-mix(in srgb, var(--quiz-ink) 10%, transparent);
}
.quiz-score {
font-size: 0.84rem;
color: var(--quiz-ink);
}
.quiz-score b { color: var(--calc-notecolor, #B45309); font-weight: 600; }
/* ---- dark theme ----------------------------------------------------- */
body.quarto-dark .quiz {
--quiz-ok: #4cb08a;
--quiz-bad: #e2798f;
--quiz-ink: #8b98a8;
}
/* ---- print ----------------------------------------------------------
* Printing the HTML is a fallback (the pdf format is the real print path).
* A printed quiz is one to fill in with a pen: the bar goes, the boxes stay
* empty, and anything already revealed on screen is kept so a checked quiz
* prints as it looks.
*/
@media print {
.quiz-bar { display: none; }
.quiz-opt.quiz-ok, .quiz-opt.quiz-bad { background: none; }
}
@@ -0,0 +1,126 @@
// quiz — judge the tick boxes of one quiz, explain what went wrong
//
// Every label the reader sees is written into the markup by quiz.lua, so the
// wording follows the book's language and nothing is translated twice. A
// quiz carries:
// data-quiz-score "{n} of {m} questions correct" ({n}/{m} substituted)
// data-quiz-right verdict of a question answered correctly
// data-quiz-wrong verdict of a question answered wrongly
//
// A question is right only when every one of its options is in the right
// state: ticked when true, left empty when false. That is the "multiple
// true/false" rule of the exam, and it is why a half-ticked question counts
// as wrong.
(function () {
"use strict";
function options(quiz) {
return quiz.querySelectorAll(".quiz-opt");
}
function judge(quiz) {
var questions = quiz.querySelectorAll(".quiz-q");
var right = 0;
questions.forEach(function (q) {
var ok = true;
q.querySelectorAll(".quiz-opt").forEach(function (opt) {
var box = opt.querySelector(".quiz-box");
if (!box) return;
var want = opt.dataset.correct === "1";
var hit = box.checked === want;
opt.classList.toggle("quiz-ok", hit);
opt.classList.toggle("quiz-bad", !hit);
// the explanation of an option is for the reader who got it wrong
var why = opt.querySelector(".quiz-why");
if (why) why.hidden = hit;
if (!hit) ok = false;
});
var verdict = q.querySelector(".quiz-verdict");
if (verdict) {
verdict.hidden = false;
verdict.textContent = ok
? (quiz.dataset.quizRight || "Correct")
: (quiz.dataset.quizWrong || "Not quite");
verdict.classList.toggle("quiz-ok", ok);
verdict.classList.toggle("quiz-bad", !ok);
}
// a question-level explanation backs up a wrong answer as a whole
var qwhy = q.querySelector(".quiz-why-q");
if (qwhy) qwhy.hidden = ok;
if (ok) right++;
});
var score = quiz.querySelector(".quiz-score");
if (score) {
var template = quiz.dataset.quizScore || "{n}/{m}";
score.innerHTML = "";
// built as nodes, not markup: the template comes from metadata
var parts = template.split(/\{n\}|\{m\}/);
var values = [];
(template.match(/\{n\}|\{m\}/g) || []).forEach(function (token) {
values.push(token === "{n}" ? right : questions.length);
});
parts.forEach(function (text, i) {
score.appendChild(document.createTextNode(text));
if (i < values.length) {
var b = document.createElement("b");
b.textContent = String(values[i]);
score.appendChild(b);
}
});
}
}
function reset(quiz) {
options(quiz).forEach(function (opt) {
var box = opt.querySelector(".quiz-box");
if (box) box.checked = false;
opt.classList.remove("quiz-ok", "quiz-bad");
var why = opt.querySelector(".quiz-why");
if (why) why.hidden = true;
});
quiz.querySelectorAll(".quiz-verdict").forEach(function (v) {
v.hidden = true;
v.textContent = "";
v.classList.remove("quiz-ok", "quiz-bad");
});
quiz.querySelectorAll(".quiz-why-q").forEach(function (w) { w.hidden = true; });
var score = quiz.querySelector(".quiz-score");
if (score) score.textContent = "";
}
document.addEventListener("click", function (event) {
var target = event.target;
if (!target.closest) return;
var check = target.closest(".quiz .quiz-check");
if (check) {
judge(check.closest(".quiz"));
return;
}
var again = target.closest(".quiz .quiz-reset");
if (again) {
reset(again.closest(".quiz"));
}
});
// re-ticking a box after checking clears that row's verdict, so a stale
// green or red never sits next to a box the reader has just changed
document.addEventListener("change", function (event) {
var box = event.target;
if (!box.closest || !box.classList || !box.classList.contains("quiz-box")) return;
var opt = box.closest(".quiz-opt");
if (!opt) return;
opt.classList.remove("quiz-ok", "quiz-bad");
var why = opt.querySelector(".quiz-why");
if (why) why.hidden = true;
});
})();
+1 -1
View File
@@ -152,5 +152,5 @@ svg:not(:has(.node)) .node { opacity: 1; }
<!-- who knows whom -->
<text class="t-sm" data-label="knows" x="14" y="176">main() knows all three: their names, argument and result types, and that they are available right now.</text>
<text class="t-mut" data-label="cost" x="14" y="202">The wiring is written into the code itself — step 1 of the tutorial.</text>
<text class="t-mut" data-label="cost" x="14" y="202">The wiring is written into the code itself — step 1.</text>
</svg>

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

+82 -19
View File
@@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>1&nbsp; Étape 0 — De quoi parle le tutoriel – De l'appel à l'événement</title>
<title>1&nbsp; Étape 0 — De quoi il s’agit – Contrôle de processus</title>
<style>
/* Default styles provided by pandoc.
** See https://pandoc.org/MANUAL.html#variables-for-html for config info.
@@ -50,9 +50,15 @@ ul.task-list li input[type="checkbox"] {
<link href="site_libs/bootstrap/bootstrap-cfe7114cbc4adb2af5ff3a891545d7fa.min.css" rel="stylesheet" append-hash="true" id="quarto-bootstrap" data-mode="light">
<script src="site_libs/quarto-contrib/calc-exo-2.0.0/exo.js"></script>
<link href="site_libs/quarto-contrib/calc-exo-2.0.0/exo.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-quiz-1.0.0/quiz.js"></script>
<link href="site_libs/quarto-contrib/calc-quiz-1.0.0/quiz.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-further-1.0.0/further.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-latex-tables-1.0.0/latex-tables.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-notes-1.0.0/calc-notes.js"></script>
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/theme.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/high-contrast.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/calc-notes.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/narrow.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-glossary-2.0.0/glossary.js"></script>
<link href="site_libs/quarto-contrib/calc-glossary-2.0.0/glossary.css" rel="stylesheet">
<script id="quarto-search-options" type="application/json">{
@@ -95,7 +101,7 @@ ul.task-list li input[type="checkbox"] {
nothing is attached to the links themselves: one capture-phase listener on
the document reads the link's final address at click time.
If a language has not been built (./render-all.sh), its pages do not exist:
If a language has not been built, its pages do not exist:
the target is checked first and a short note is shown instead of a
"Not Found" page.
@@ -111,12 +117,9 @@ ul.task-list li input[type="checkbox"] {
var ROOT_LANG = 'en'; // the language at the top of _book/
var COOKIE = 'notes-lang';
var NOTE = {
de: 'Diese Sprache wurde noch nicht erstellt. Einmal ./render-all.sh ausführen – '
+ 'danach funktioniert der Wechsel auch in der Vorschau.',
fr: 'Cette langue n’a pas encore été générée. Lancez une fois ./render-all.sh : '
+ 'ensuite le changement fonctionne aussi dans l’aperçu.',
en: 'This language hasn’t been built yet. Run ./render-all.sh once, '
+ 'then switching works in the preview too.'
de: 'Diese Sprache ist hier noch nicht verfügbar.',
fr: 'Cette langue n’est pas encore disponible ici.',
en: 'This language is not available here yet.'
};
var here = (document.documentElement.lang || ROOT_LANG).slice(0, 2);
@@ -130,9 +133,20 @@ ul.task-list li input[type="checkbox"] {
var m = document.cookie.match(/(?:^|;\s*)notes-lang=(de|fr|en)(?:;|$)/);
return m ? m[1] : null;
}
// path '/' on purpose: every book of these notes is served from one host,
// each under its own folder, so a language picked in any of them is the
// language all of them open in. A book hosted on its own would be no worse
// off -- the cookie simply has nothing else to reach.
var COOKIE_PATH = '/';
function remember(code) {
document.cookie = COOKIE + '=' + code + '; path=' + root + '; max-age=31536000; SameSite=Lax'
document.cookie = COOKIE + '=' + code + '; path=' + COOKIE_PATH
+ '; max-age=31536000; SameSite=Lax'
+ (location.protocol === 'https:' ? '; Secure' : '');
// a copy written under the book's own path by an earlier version would be
// the more specific one and would shadow the shared cookie for good
if (root !== COOKIE_PATH) {
document.cookie = COOKIE + '=; path=' + root + '; max-age=0';
}
}
// a returning reader lands in the language picked last time
@@ -154,7 +168,11 @@ ul.task-list li input[type="checkbox"] {
box.style.cssText = 'position:fixed;left:50%;bottom:1.25rem;transform:translateX(-50%);'
+ 'max-width:min(34rem,calc(100vw - 2rem));padding:.6rem .9rem;border-radius:6px;'
+ 'background:#1f2328;color:#fff;font-size:.85rem;line-height:1.4;z-index:2000;'
+ 'box-shadow:0 4px 16px rgba(0,0,0,.25)';
// a status message, so it keeps its own dark surface in either mode; the
// hairline is the page's rule colour, invisible on a light page and an
// edge against a dark one, where the shadow alone no longer separates it
+ 'border:1px solid var(--calc-line,#444);'
+ 'box-shadow:0 4px 16px var(--calc-shadow,rgba(0,0,0,.25))';
document.body.appendChild(box);
setTimeout(function () { box.remove(); }, 7000);
}
@@ -195,7 +213,35 @@ ul.task-list li input[type="checkbox"] {
}, true);
})();
</script>
<style>:root { --calc-notecolor: #B45309; }</style>
<style>:root {
--calc-furthercolor-src: #6B3FA0;
--calc-furthercolor: var(--calc-furthercolor-src);
}</style>
<style>:root {
--calc-notecolor-src: #B45309;
--calc-notecolor: var(--calc-notecolor-src);
}</style>
<script>(function (e) {
var KEY = 'notes-contrast', forced = false;
var picked = null;
try { picked = localStorage.getItem(KEY); } catch (err) {}
var q = null;
try { q = window.matchMedia && window.matchMedia('(prefers-contrast: more)'); } catch (err) {}
if (picked === 'more' || (picked !== 'normal' && (forced || (q && q.matches)))) {
e.classList.add('hc');
}
if (q) {
var f = function () {
var p = null;
try { p = localStorage.getItem(KEY); } catch (err) {}
if (p === null) e.classList.toggle('hc', forced || q.matches);
};
if (q.addEventListener) q.addEventListener('change', f);
else if (q.addListener) q.addListener(f);
}
})(document.documentElement);</script>
</head>
@@ -209,7 +255,7 @@ ul.task-list li input[type="checkbox"] {
<button type="button" class="quarto-btn-toggle btn" data-bs-toggle="collapse" role="button" data-bs-target=".quarto-sidebar-collapse-item" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Basculer la barre latérale" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
<i class="bi bi-layout-text-sidebar-reverse"></i>
</button>
<nav class="quarto-page-breadcrumbs" aria-label="breadcrumb"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="./00-orientation.html"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Étape 0 — De quoi parle le tutoriel</span></a></li></ol></nav>
<nav class="quarto-page-breadcrumbs" aria-label="breadcrumb"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="./00-orientation.html"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Étape 0 — De quoi il s’agit</span></a></li></ol></nav>
<a class="flex-grow-1" role="navigation" data-bs-toggle="collapse" data-bs-target=".quarto-sidebar-collapse-item" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="Basculer la barre latérale" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
</a>
<button type="button" class="btn quarto-search-button" aria-label="Recherche" onclick="window.quartoOpenSearch();">
@@ -224,7 +270,7 @@ ul.task-list li input[type="checkbox"] {
<nav id="quarto-sidebar" class="sidebar collapse collapse-horizontal quarto-sidebar-collapse-item sidebar-navigation docked overflow-auto">
<div class="pt-lg-2 mt-2 text-left sidebar-header">
<div class="sidebar-title mb-0 py-0">
<a href="./">De l’appel à l’événement</a>
<a href="./">Contrôle de processus</a>
<div class="sidebar-tools-main tools-wide">
<div class="dropdown">
<a href="" title="" id="quarto-navigation-tool-dropdown-0" class="quarto-navigation-tool dropdown-toggle px-1" data-bs-toggle="dropdown" aria-expanded="false" role="link" aria-label=""><i class="bi bi-translate"></i></a>
@@ -246,7 +292,7 @@ ul.task-list li input[type="checkbox"] {
</li>
</ul>
</div>
<a href="./De-l-appel-à-l-événement.pdf" title="Download PDF" class="quarto-navigation-tool px-1" aria-label="Download PDF"><i class="bi bi-file-pdf"></i></a>
<a href="./Contrôle-de-processus.pdf" title="Download PDF" class="quarto-navigation-tool px-1" aria-label="Download PDF"><i class="bi bi-file-pdf"></i></a>
<a href="" class="quarto-reader-toggle quarto-navigation-tool px-1" onclick="window.quartoToggleReader(); return false;" title="Basculer en mode lecteur">
<div class="quarto-reader-toggle-btn">
<i class="bi"></i>
@@ -271,7 +317,7 @@ ul.task-list li input[type="checkbox"] {
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./00-orientation.html" class="sidebar-item-text sidebar-link active">
<span class="menu-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Étape 0 — De quoi parle le tutoriel</span></span></a>
<span class="menu-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Étape 0 — De quoi il s’agit</span></span></a>
</div>
</li>
<li class="sidebar-item">
@@ -285,6 +331,23 @@ ul.task-list li input[type="checkbox"] {
<a href="./02-part-ii-processes.html" class="sidebar-item-text sidebar-link">
<span class="menu-text"><span class="chapter-number">3</span>&nbsp; <span class="chapter-title">Partie II — Franchir la frontière de processus</span></span></a>
</div>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a class="sidebar-item-text sidebar-link text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" role="navigation" aria-expanded="false">
<span class="menu-text">Annexes</span></a>
<a class="sidebar-item-toggle text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" role="navigation" aria-expanded="false" aria-label="Basculer la section">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-1" class="collapse list-unstyled sidebar-section depth1 ">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./glossary.html" class="sidebar-item-text sidebar-link">
<span class="menu-text">Glossaire</span></a>
</div>
</li>
</ul>
</li>
</ul>
</div>
@@ -305,7 +368,7 @@ ul.task-list li input[type="checkbox"] {
<header id="title-block-header" class="quarto-title-block default">
<div class="quarto-title">
<h1 class="title"><span id="sec-step-0" class="quarto-section-identifier"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Étape 0 — De quoi parle le tutoriel</span></span></h1>
<h1 class="title"><span id="sec-step-0" class="quarto-section-identifier"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Étape 0 — De quoi il s’agit</span></span></h1>
</div>
@@ -324,11 +387,11 @@ ul.task-list li input[type="checkbox"] {
<!-- MULTILINGUAL: see the comment at the top of index.qmd. -->
<p>L’étape 0 ne contient aucun code. Elle énonce le sujet : non pas ROT13, mais l’architecture autour de lui. La fonctionnalité reste presque inchangée pendant 81 étapes, et c’est précisément ce qui rend visibles les changements alentour.</p>
<p>Deux règles sont posées ici et valent pour tout le tutoriel :</p>
<p>Deux règles sont posées ici et valent jusqu’au bout :</p>
<blockquote class="blockquote">
<p><strong>Ne rencontrer une solution qu’après avoir vécu le problème qu’elle résout.</strong></p>
</blockquote>
<p>C’est pourquoi le tutoriel ne commence ni par MQTT, ni par les abonnements dynamiques. Il construit d’abord un système aux médiateurs délibérément maladroits, le met en service, et demande seulement ensuite s’ils ont mérité leur place.</p>
<p>C’est pourquoi la construction ne commence ni par MQTT, ni par les abonnements dynamiques. Un système aux médiateurs délibérément maladroits est bâti d’abord, mis en service, et l’on demande seulement ensuite s’ils ont mérité leur place.</p>
<p>La seconde règle concerne le vocabulaire : <em>Intent</em>, <em>Status/State</em> et <em>Event</em> ne sont nommés qu’après avoir été utilisés. Ils apparaissent vers l’étape 42, pas avant.</p>
<p>L’itinéraire prévu, dès l’étape 0 :</p>
<pre class="text"><code>direct method calls → egoistic services → mediators → separate processes
@@ -341,7 +404,7 @@ ul.task-list li input[type="checkbox"] {
<table class="caption-top table">
<thead>
<tr class="header">
<th>Ce que demande le tutoriel</th>
<th>Telle qu’elle est posée ici</th>
<th>Une version plus faible</th>
</tr>
</thead>
+86 -23
View File
@@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>2&nbsp; Partie I — Commencer par ce que l’on connaît déjà – De l'appel à l'événement</title>
<title>2&nbsp; Partie I — Commencer par ce que l’on connaît déjà – Contrôle de processus</title>
<style>
/* Default styles provided by pandoc.
** See https://pandoc.org/MANUAL.html#variables-for-html for config info.
@@ -85,9 +85,15 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<link href="site_libs/bootstrap/bootstrap-cfe7114cbc4adb2af5ff3a891545d7fa.min.css" rel="stylesheet" append-hash="true" id="quarto-bootstrap" data-mode="light">
<script src="site_libs/quarto-contrib/calc-exo-2.0.0/exo.js"></script>
<link href="site_libs/quarto-contrib/calc-exo-2.0.0/exo.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-quiz-1.0.0/quiz.js"></script>
<link href="site_libs/quarto-contrib/calc-quiz-1.0.0/quiz.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-further-1.0.0/further.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-latex-tables-1.0.0/latex-tables.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-notes-1.0.0/calc-notes.js"></script>
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/theme.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/high-contrast.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/calc-notes.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/narrow.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-glossary-2.0.0/glossary.js"></script>
<link href="site_libs/quarto-contrib/calc-glossary-2.0.0/glossary.css" rel="stylesheet">
<script id="quarto-search-options" type="application/json">{
@@ -130,7 +136,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
nothing is attached to the links themselves: one capture-phase listener on
the document reads the link's final address at click time.
If a language has not been built (./render-all.sh), its pages do not exist:
If a language has not been built, its pages do not exist:
the target is checked first and a short note is shown instead of a
"Not Found" page.
@@ -146,12 +152,9 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
var ROOT_LANG = 'en'; // the language at the top of _book/
var COOKIE = 'notes-lang';
var NOTE = {
de: 'Diese Sprache wurde noch nicht erstellt. Einmal ./render-all.sh ausführen – '
+ 'danach funktioniert der Wechsel auch in der Vorschau.',
fr: 'Cette langue n’a pas encore été générée. Lancez une fois ./render-all.sh : '
+ 'ensuite le changement fonctionne aussi dans l’aperçu.',
en: 'This language hasn’t been built yet. Run ./render-all.sh once, '
+ 'then switching works in the preview too.'
de: 'Diese Sprache ist hier noch nicht verfügbar.',
fr: 'Cette langue n’est pas encore disponible ici.',
en: 'This language is not available here yet.'
};
var here = (document.documentElement.lang || ROOT_LANG).slice(0, 2);
@@ -165,9 +168,20 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
var m = document.cookie.match(/(?:^|;\s*)notes-lang=(de|fr|en)(?:;|$)/);
return m ? m[1] : null;
}
// path '/' on purpose: every book of these notes is served from one host,
// each under its own folder, so a language picked in any of them is the
// language all of them open in. A book hosted on its own would be no worse
// off -- the cookie simply has nothing else to reach.
var COOKIE_PATH = '/';
function remember(code) {
document.cookie = COOKIE + '=' + code + '; path=' + root + '; max-age=31536000; SameSite=Lax'
document.cookie = COOKIE + '=' + code + '; path=' + COOKIE_PATH
+ '; max-age=31536000; SameSite=Lax'
+ (location.protocol === 'https:' ? '; Secure' : '');
// a copy written under the book's own path by an earlier version would be
// the more specific one and would shadow the shared cookie for good
if (root !== COOKIE_PATH) {
document.cookie = COOKIE + '=; path=' + root + '; max-age=0';
}
}
// a returning reader lands in the language picked last time
@@ -189,7 +203,11 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
box.style.cssText = 'position:fixed;left:50%;bottom:1.25rem;transform:translateX(-50%);'
+ 'max-width:min(34rem,calc(100vw - 2rem));padding:.6rem .9rem;border-radius:6px;'
+ 'background:#1f2328;color:#fff;font-size:.85rem;line-height:1.4;z-index:2000;'
+ 'box-shadow:0 4px 16px rgba(0,0,0,.25)';
// a status message, so it keeps its own dark surface in either mode; the
// hairline is the page's rule colour, invisible on a light page and an
// edge against a dark one, where the shadow alone no longer separates it
+ 'border:1px solid var(--calc-line,#444);'
+ 'box-shadow:0 4px 16px var(--calc-shadow,rgba(0,0,0,.25))';
document.body.appendChild(box);
setTimeout(function () { box.remove(); }, 7000);
}
@@ -230,7 +248,35 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
}, true);
})();
</script>
<style>:root { --calc-notecolor: #B45309; }</style>
<style>:root {
--calc-furthercolor-src: #6B3FA0;
--calc-furthercolor: var(--calc-furthercolor-src);
}</style>
<style>:root {
--calc-notecolor-src: #B45309;
--calc-notecolor: var(--calc-notecolor-src);
}</style>
<script>(function (e) {
var KEY = 'notes-contrast', forced = false;
var picked = null;
try { picked = localStorage.getItem(KEY); } catch (err) {}
var q = null;
try { q = window.matchMedia && window.matchMedia('(prefers-contrast: more)'); } catch (err) {}
if (picked === 'more' || (picked !== 'normal' && (forced || (q && q.matches)))) {
e.classList.add('hc');
}
if (q) {
var f = function () {
var p = null;
try { p = localStorage.getItem(KEY); } catch (err) {}
if (p === null) e.classList.toggle('hc', forced || q.matches);
};
if (q.addEventListener) q.addEventListener('change', f);
else if (q.addListener) q.addListener(f);
}
})(document.documentElement);</script>
</head>
@@ -259,7 +305,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<nav id="quarto-sidebar" class="sidebar collapse collapse-horizontal quarto-sidebar-collapse-item sidebar-navigation docked overflow-auto">
<div class="pt-lg-2 mt-2 text-left sidebar-header">
<div class="sidebar-title mb-0 py-0">
<a href="./">De l’appel à l’événement</a>
<a href="./">Contrôle de processus</a>
<div class="sidebar-tools-main tools-wide">
<div class="dropdown">
<a href="" title="" id="quarto-navigation-tool-dropdown-0" class="quarto-navigation-tool dropdown-toggle px-1" data-bs-toggle="dropdown" aria-expanded="false" role="link" aria-label=""><i class="bi bi-translate"></i></a>
@@ -281,7 +327,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
</li>
</ul>
</div>
<a href="./De-l-appel-à-l-événement.pdf" title="Download PDF" class="quarto-navigation-tool px-1" aria-label="Download PDF"><i class="bi bi-file-pdf"></i></a>
<a href="./Contrôle-de-processus.pdf" title="Download PDF" class="quarto-navigation-tool px-1" aria-label="Download PDF"><i class="bi bi-file-pdf"></i></a>
<a href="" class="quarto-reader-toggle quarto-navigation-tool px-1" onclick="window.quartoToggleReader(); return false;" title="Basculer en mode lecteur">
<div class="quarto-reader-toggle-btn">
<i class="bi"></i>
@@ -306,7 +352,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./00-orientation.html" class="sidebar-item-text sidebar-link">
<span class="menu-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Étape 0 — De quoi parle le tutoriel</span></span></a>
<span class="menu-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Étape 0 — De quoi il s’agit</span></span></a>
</div>
</li>
<li class="sidebar-item">
@@ -320,6 +366,23 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<a href="./02-part-ii-processes.html" class="sidebar-item-text sidebar-link">
<span class="menu-text"><span class="chapter-number">3</span>&nbsp; <span class="chapter-title">Partie II — Franchir la frontière de processus</span></span></a>
</div>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a class="sidebar-item-text sidebar-link text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" role="navigation" aria-expanded="false">
<span class="menu-text">Annexes</span></a>
<a class="sidebar-item-toggle text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" role="navigation" aria-expanded="false" aria-label="Basculer la section">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-1" class="collapse list-unstyled sidebar-section depth1 ">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./glossary.html" class="sidebar-item-text sidebar-link">
<span class="menu-text">Glossaire</span></a>
</div>
</li>
</ul>
</li>
</ul>
</div>
@@ -398,7 +461,7 @@ Figure&nbsp;2.1: La version procédurale. Le câblage est écrit dans le code :
<section id="sec-step-2" class="level2" data-number="2.2">
<h2 data-number="2.2" class="anchored" data-anchor-id="sec-step-2"><span class="header-section-number">2.2</span> Étape 2 — Trois capacités égoïstes</h2>
<p>Un composant <strong>égoïste</strong> dit : je sais ce que je peux faire, quelles données j’accepte et quelles données je produis — et je préfère ne pas connaître le processus métier qui m’entoure. Concrètement, <code>ConsoleIn</code> ne doit pas contenir <code>rot13(...)</code>, et <code>ROT13</code> ne doit pas contenir <code>consoleOut(...)</code>.</p>
<p>Supprimer ces appels crée aussitôt un problème, que le tutoriel formule en question : si personne ne connaît personne, <strong>qui fait de cela un système ?</strong> Notez ce que la question ne dit pas : la connaissance n’a pas disparu, elle doit aller ailleurs. Il manque deux liaisons, pas une — <code>ConsoleIn ↔︎ ROT13</code> et <code>ROT13 ↔︎ ConsoleOut</code>.</p>
<p>Supprimer ces appels crée aussitôt un problème, qui se pose en question : si personne ne connaît personne, <strong>qui fait de cela un système ?</strong> Notez ce que la question ne dit pas : la connaissance n’a pas disparu, elle doit aller ailleurs. Il manque deux liaisons, pas une — <code>ConsoleIn ↔︎ ROT13</code> et <code>ROT13 ↔︎ ConsoleOut</code>.</p>
</section>
<section id="sec-step-3" class="level2" data-number="2.3">
<h2 data-number="2.3" class="anchored" data-anchor-id="sec-step-3"><span class="header-section-number">2.3</span> Étape 3 — Donner une boîte aux lettres à chaque capacité</h2>
@@ -410,7 +473,7 @@ Figure&nbsp;2.1: La version procédurale. Le câblage est écrit dans le code :
<span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a><span class="bu">BlockingQueue</span><span class="op">&lt;</span>Message<span class="op">&gt;</span> <span class="fu">mailbox</span><span class="op">(</span><span class="bu">String</span> name<span class="op">)</span> <span class="op">{</span></span>
<span id="cb2-6"><a href="#cb2-6" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> mailboxes<span class="op">.</span><span class="fu">computeIfAbsent</span><span class="op">(</span>name<span class="op">,</span> _ <span class="op">-&gt;</span> <span class="kw">new</span> <span class="bu">LinkedBlockingQueue</span><span class="op">&lt;&gt;());</span></span>
<span id="cb2-7"><a href="#cb2-7" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div><button title="Copier vers le presse-papier" class="code-copy-button"><i class="bi"></i></button></div>
<p>Le tutoriel insiste pour appeler cela des <strong>boîtes aux lettres</strong> (<em>mailboxes</em>) et non des sujets (<em>topics</em>), et il en donne la raison : si deux lecteurs appellent <code>take()</code> sur la même boîte, ils sont en concurrence — chaque message va à <em>un seul</em> d’entre eux et n’est pas copié aux deux. Un <em>topic</em>, en Publish/Subscribe, remettrait à chaque abonné sa propre copie. Un lecteur par message suffit pour l’instant, et la limitation est conservée volontairement : c’est elle qui rendra visible plus tard ce que Publish/Subscribe apporte réellement.</p>
<p>Ce sont des <strong>boîtes aux lettres</strong> (<em>mailboxes</em>) et non des sujets (<em>topics</em>), et la distinction mérite qu’on y insiste : si deux lecteurs appellent <code>take()</code> sur la même boîte, ils sont en concurrence — chaque message va à <em>un seul</em> d’entre eux et n’est pas copié aux deux. Un <em>topic</em>, en Publish/Subscribe, remettrait à chaque abonné sa propre copie. Un lecteur par message suffit pour l’instant, et la limitation est conservée volontairement : c’est elle qui rendra visible plus tard ce que Publish/Subscribe apporte réellement.</p>
</section>
<section id="sec-steps-4-6" class="level2" data-number="2.4">
<h2 data-number="2.4" class="anchored" data-anchor-id="sec-steps-4-6"><span class="header-section-number">2.4</span> Étapes 4–6 — Les trois capacités deviennent égoïstes</h2>
@@ -441,7 +504,7 @@ Figure&nbsp;2.1: La version procédurale. Le câblage est écrit dans le code :
</tr>
</tbody>
</table>
<p>Aucune capacité ne contient le nom d’une autre. Le résumé du tutoriel lui-même : « trois capacités bien isolées. Et elles ne font absolument rien ensemble. » Rien ne déplace un message de <code>consoleIn.outbox</code> vers <code>rot13.inbox</code>, ni de <code>rot13.outbox</code> vers <code>consoleOut.inbox</code>.</p>
<p>Aucune capacité ne contient le nom d’une autre, et c’est exactement le résultat : trois capacités bien isolées qui ne font absolument rien ensemble. Rien ne déplace un message de <code>consoleIn.outbox</code> vers <code>rot13.inbox</code>, ni de <code>rot13.outbox</code> vers <code>consoleOut.inbox</code>.</p>
</section>
<section id="sec-step-7" class="level2" data-number="2.5">
<h2 data-number="2.5" class="anchored" data-anchor-id="sec-step-7"><span class="header-section-number">2.5</span> Étape 7 — Entre le médiateur</h2>
@@ -466,7 +529,7 @@ Figure&nbsp;2.2: La version médiatisée dans une seule JVM. Dans la version web
<section id="sec-step-8" class="level2" data-number="2.6">
<h2 data-number="2.6" class="anchored" data-anchor-id="sec-step-8"><span class="header-section-number">2.6</span> Étape 8 — Redemander : qui connaît qui ?</h2>
<p>ConsoleIn connaît-il ROT13 ? Non. ROT13 connaît-il ConsoleIn ou ConsoleOut ? Non. La topologie a-t-elle disparu ? Non — elle se trouve dans les deux appels <code>mediate(...)</code> à l’intérieur de <code>main()</code>.</p>
<p>C’est le premier résultat majeur du tutoriel :</p>
<p>C’est le premier résultat majeur :</p>
<blockquote class="blockquote">
<p><strong>Le découplage ne fait souvent pas disparaître la connaissance. Il la déplace là où elle appartient.</strong></p>
</blockquote>
@@ -475,7 +538,7 @@ Figure&nbsp;2.2: La version médiatisée dans une seule JVM. Dans la version web
<section id="sec-step-9" class="level2" data-number="2.7">
<h2 data-number="2.7" class="anchored" data-anchor-id="sec-step-9"><span class="header-section-number">2.7</span> Étape 9 — Pourquoi des threads virtuels ?</h2>
<p>Cinq boucles attendent désormais indéfiniment : le clavier, <code>rot13.inbox</code>, <code>consoleOut.inbox</code> et les sources des deux médiateurs. Les threads virtuels sont simplement le moyen Java peu coûteux de faire attendre cinq choses à la fois dans une seule JVM.</p>
<p>C’est une commodité d’implémentation, pas une architecture. L’architecture — qui connaît qui, et où vit le câblage — réside dans les noms de boîtes, pas dans les threads. La preuve que donne le tutoriel : la même architecture tournera en processus séparés à l’étape 11, sans aucun thread partagé entre les parties.</p>
<p>C’est une commodité d’implémentation, pas une architecture. L’architecture — qui connaît qui, et où vit le câblage — réside dans les noms de boîtes, pas dans les threads. La preuve de cette séparation : la même architecture tournera en processus séparés à l’étape 11, sans aucun thread partagé entre les parties.</p>
</section>
<section id="sec-step-10" class="level2" data-number="2.8">
<h2 data-number="2.8" class="anchored" data-anchor-id="sec-step-10"><span class="header-section-number">2.8</span> Étape 10 — Garder les services égoïstes</h2>
@@ -507,7 +570,7 @@ Figure&nbsp;2.2: La version médiatisée dans une seule JVM. Dans la version web
</tr>
</tbody>
</table>
<p>Le tutoriel est honnête sur le prix : ce design « peut sembler indirect — voire un peu bizarre », et il promet une autre manière de garder les services égoïstes <em>sans</em> médiateur sur le chemin de chaque message.</p>
<p>Le prix mérite d’être dit clairement : ce design peut sembler indirect — voire un peu bizarre. Il existe une autre manière de garder les services égoïstes <em>sans</em> médiateur sur le chemin de chaque message ; elle viendra plus tard.</p>
</section>
<section id="sec-part-i-result" class="level2" data-number="2.9">
<h2 data-number="2.9" class="anchored" data-anchor-id="sec-part-i-result"><span class="header-section-number">2.9</span> Ce que la partie I a déplacé</h2>
@@ -537,7 +600,7 @@ Figure&nbsp;2.2: La version médiatisée dans une seule JVM. Dans la version web
</tr>
</tbody>
</table>
<p>Fonctionnalité : inchangée. Lignes de code : davantage. Parties qui se connaissent : aucune. C’est le compromis que le reste du tutoriel continue de mettre à l’épreuve.</p>
<p>Fonctionnalité : inchangée. Lignes de code : davantage. Parties qui se connaissent : aucune. C’est le compromis que tout ce qui suit continue de mettre à l’épreuve.</p>
</section>
@@ -1164,8 +1227,8 @@ Figure&nbsp;2.2: La version médiatisée dans une seule JVM. Dans la version web
</script>
<nav class="page-navigation">
<div class="nav-page nav-page-previous">
<a href="./00-orientation.html" class="pagination-link" aria-label="[Step 0 — What the tutorial is about]{.en}[Étape 0 — De quoi parle le tutoriel]{.fr}[Schritt 0 — Worum es im Tutorial geht]{.de}">
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Étape 0 — De quoi parle le tutoriel</span></span>
<a href="./00-orientation.html" class="pagination-link" aria-label="[Step 0 — What this is about]{.en}[Étape 0 — De quoi il s'agit]{.fr}[Schritt 0 — Worum es geht]{.de}">
<i class="bi bi-arrow-left-short"></i> <span class="nav-page-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Étape 0 — De quoi il s’agit</span></span>
</a>
</div>
<div class="nav-page nav-page-next">
+86 -19
View File
@@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>3&nbsp; Partie II — Franchir la frontière de processus – De l'appel à l'événement</title>
<title>3&nbsp; Partie II — Franchir la frontière de processus – Contrôle de processus</title>
<style>
/* Default styles provided by pandoc.
** See https://pandoc.org/MANUAL.html#variables-for-html for config info.
@@ -71,6 +71,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<script src="site_libs/quarto-search/fuse.min.js"></script>
<script src="site_libs/quarto-search/quarto-search.js"></script>
<meta name="quarto:offset" content="./">
<link href="./glossary.html" rel="next">
<link href="./01-part-i-calls.html" rel="prev">
<script src="site_libs/quarto-html/quarto.js" type="module"></script>
<script src="site_libs/quarto-html/tabsets/tabsets.js" type="module"></script>
@@ -84,9 +85,15 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<link href="site_libs/bootstrap/bootstrap-cfe7114cbc4adb2af5ff3a891545d7fa.min.css" rel="stylesheet" append-hash="true" id="quarto-bootstrap" data-mode="light">
<script src="site_libs/quarto-contrib/calc-exo-2.0.0/exo.js"></script>
<link href="site_libs/quarto-contrib/calc-exo-2.0.0/exo.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-quiz-1.0.0/quiz.js"></script>
<link href="site_libs/quarto-contrib/calc-quiz-1.0.0/quiz.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-further-1.0.0/further.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-latex-tables-1.0.0/latex-tables.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-notes-1.0.0/calc-notes.js"></script>
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/theme.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/high-contrast.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/calc-notes.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/narrow.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-glossary-2.0.0/glossary.js"></script>
<link href="site_libs/quarto-contrib/calc-glossary-2.0.0/glossary.css" rel="stylesheet">
<script id="quarto-search-options" type="application/json">{
@@ -129,7 +136,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
nothing is attached to the links themselves: one capture-phase listener on
the document reads the link's final address at click time.
If a language has not been built (./render-all.sh), its pages do not exist:
If a language has not been built, its pages do not exist:
the target is checked first and a short note is shown instead of a
"Not Found" page.
@@ -145,12 +152,9 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
var ROOT_LANG = 'en'; // the language at the top of _book/
var COOKIE = 'notes-lang';
var NOTE = {
de: 'Diese Sprache wurde noch nicht erstellt. Einmal ./render-all.sh ausführen – '
+ 'danach funktioniert der Wechsel auch in der Vorschau.',
fr: 'Cette langue n’a pas encore été générée. Lancez une fois ./render-all.sh : '
+ 'ensuite le changement fonctionne aussi dans l’aperçu.',
en: 'This language hasn’t been built yet. Run ./render-all.sh once, '
+ 'then switching works in the preview too.'
de: 'Diese Sprache ist hier noch nicht verfügbar.',
fr: 'Cette langue n’est pas encore disponible ici.',
en: 'This language is not available here yet.'
};
var here = (document.documentElement.lang || ROOT_LANG).slice(0, 2);
@@ -164,9 +168,20 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
var m = document.cookie.match(/(?:^|;\s*)notes-lang=(de|fr|en)(?:;|$)/);
return m ? m[1] : null;
}
// path '/' on purpose: every book of these notes is served from one host,
// each under its own folder, so a language picked in any of them is the
// language all of them open in. A book hosted on its own would be no worse
// off -- the cookie simply has nothing else to reach.
var COOKIE_PATH = '/';
function remember(code) {
document.cookie = COOKIE + '=' + code + '; path=' + root + '; max-age=31536000; SameSite=Lax'
document.cookie = COOKIE + '=' + code + '; path=' + COOKIE_PATH
+ '; max-age=31536000; SameSite=Lax'
+ (location.protocol === 'https:' ? '; Secure' : '');
// a copy written under the book's own path by an earlier version would be
// the more specific one and would shadow the shared cookie for good
if (root !== COOKIE_PATH) {
document.cookie = COOKIE + '=; path=' + root + '; max-age=0';
}
}
// a returning reader lands in the language picked last time
@@ -188,7 +203,11 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
box.style.cssText = 'position:fixed;left:50%;bottom:1.25rem;transform:translateX(-50%);'
+ 'max-width:min(34rem,calc(100vw - 2rem));padding:.6rem .9rem;border-radius:6px;'
+ 'background:#1f2328;color:#fff;font-size:.85rem;line-height:1.4;z-index:2000;'
+ 'box-shadow:0 4px 16px rgba(0,0,0,.25)';
// a status message, so it keeps its own dark surface in either mode; the
// hairline is the page's rule colour, invisible on a light page and an
// edge against a dark one, where the shadow alone no longer separates it
+ 'border:1px solid var(--calc-line,#444);'
+ 'box-shadow:0 4px 16px var(--calc-shadow,rgba(0,0,0,.25))';
document.body.appendChild(box);
setTimeout(function () { box.remove(); }, 7000);
}
@@ -229,7 +248,35 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
}, true);
})();
</script>
<style>:root { --calc-notecolor: #B45309; }</style>
<style>:root {
--calc-furthercolor-src: #6B3FA0;
--calc-furthercolor: var(--calc-furthercolor-src);
}</style>
<style>:root {
--calc-notecolor-src: #B45309;
--calc-notecolor: var(--calc-notecolor-src);
}</style>
<script>(function (e) {
var KEY = 'notes-contrast', forced = false;
var picked = null;
try { picked = localStorage.getItem(KEY); } catch (err) {}
var q = null;
try { q = window.matchMedia && window.matchMedia('(prefers-contrast: more)'); } catch (err) {}
if (picked === 'more' || (picked !== 'normal' && (forced || (q && q.matches)))) {
e.classList.add('hc');
}
if (q) {
var f = function () {
var p = null;
try { p = localStorage.getItem(KEY); } catch (err) {}
if (p === null) e.classList.toggle('hc', forced || q.matches);
};
if (q.addEventListener) q.addEventListener('change', f);
else if (q.addListener) q.addListener(f);
}
})(document.documentElement);</script>
</head>
@@ -258,7 +305,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<nav id="quarto-sidebar" class="sidebar collapse collapse-horizontal quarto-sidebar-collapse-item sidebar-navigation docked overflow-auto">
<div class="pt-lg-2 mt-2 text-left sidebar-header">
<div class="sidebar-title mb-0 py-0">
<a href="./">De l’appel à l’événement</a>
<a href="./">Contrôle de processus</a>
<div class="sidebar-tools-main tools-wide">
<div class="dropdown">
<a href="" title="" id="quarto-navigation-tool-dropdown-0" class="quarto-navigation-tool dropdown-toggle px-1" data-bs-toggle="dropdown" aria-expanded="false" role="link" aria-label=""><i class="bi bi-translate"></i></a>
@@ -280,7 +327,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
</li>
</ul>
</div>
<a href="./De-l-appel-à-l-événement.pdf" title="Download PDF" class="quarto-navigation-tool px-1" aria-label="Download PDF"><i class="bi bi-file-pdf"></i></a>
<a href="./Contrôle-de-processus.pdf" title="Download PDF" class="quarto-navigation-tool px-1" aria-label="Download PDF"><i class="bi bi-file-pdf"></i></a>
<a href="" class="quarto-reader-toggle quarto-navigation-tool px-1" onclick="window.quartoToggleReader(); return false;" title="Basculer en mode lecteur">
<div class="quarto-reader-toggle-btn">
<i class="bi"></i>
@@ -305,7 +352,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./00-orientation.html" class="sidebar-item-text sidebar-link">
<span class="menu-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Étape 0 — De quoi parle le tutoriel</span></span></a>
<span class="menu-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Étape 0 — De quoi il s’agit</span></span></a>
</div>
</li>
<li class="sidebar-item">
@@ -319,6 +366,23 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<a href="./02-part-ii-processes.html" class="sidebar-item-text sidebar-link active">
<span class="menu-text"><span class="chapter-number">3</span>&nbsp; <span class="chapter-title">Partie II — Franchir la frontière de processus</span></span></a>
</div>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a class="sidebar-item-text sidebar-link text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" role="navigation" aria-expanded="false">
<span class="menu-text">Annexes</span></a>
<a class="sidebar-item-toggle text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" role="navigation" aria-expanded="false" aria-label="Basculer la section">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-1" class="collapse list-unstyled sidebar-section depth1 ">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./glossary.html" class="sidebar-item-text sidebar-link">
<span class="menu-text">Glossaire</span></a>
</div>
</li>
</ul>
</li>
</ul>
</div>
@@ -367,7 +431,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<section id="sec-step-11" class="level2" data-number="3.1">
<h2 data-number="3.1" class="anchored" data-anchor-id="sec-step-11"><span class="header-section-number">3.1</span> Étape 11 — Séparer les composants</h2>
<p>Trois processus ne peuvent pas partager une <code>BlockingQueue</code> : chaque commande <code>java</code> démarre sa propre JVM avec sa propre mémoire, la carte <code>mailboxes</code> existerait donc en trois exemplaires et chacun ne verrait que ses propres messages. Il faut un transport externe.</p>
<p>TCP conviendrait, MQTT conviendrait. Le tutoriel choisit délibérément l’option la plus primitive, le <strong>système de fichiers</strong>, avec une raison en une ligne : <em>parce qu’on peut le voir</em>. Les messages deviennent des fichiers que l’on peut lister avec <code>ls</code> et lire avec <code>cat</code> pendant que le système tourne. Primitif ne veut pas dire inférieur : la partie VIII revient sur ce que le système de fichiers fait vraiment bien et vraiment mal.</p>
<p>TCP conviendrait, MQTT conviendrait. C’est délibérément l’option la plus primitive qui est choisie, le <strong>système de fichiers</strong>, pour une raison en une ligne : <em>parce qu’on peut le voir</em>. Les messages deviennent des fichiers que l’on peut lister avec <code>ls</code> et lire avec <code>cat</code> pendant que le système tourne. Primitif ne veut pas dire inférieur : la partie VIII revient sur ce que le système de fichiers fait vraiment bien et vraiment mal.</p>
</section>
<section id="sec-steps-12-13" class="level2" data-number="3.2">
<h2 data-number="3.2" class="anchored" data-anchor-id="sec-steps-12-13"><span class="header-section-number">3.2</span> Étapes 12–13 — Un répertoire devient une boîte aux lettres</h2>
@@ -410,7 +474,7 @@ TIMESTAMP: 2026-09-22T10:42:12.123Z</code></pre>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb5"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="bu">printf</span> <span class="st">'TEXT\nHello from a file'</span> <span class="op">&gt;</span> messageBoard/consoleOut/inbox/manual.tmp</span>
<span id="cb5-2"><a href="#cb5-2" aria-hidden="true" tabindex="-1"></a><span class="fu">mv</span> messageBoard/consoleOut/inbox/manual.tmp messageBoard/consoleOut/inbox/manual.msg</span></code></pre></div><button title="Copier vers le presse-papier" class="code-copy-button"><i class="bi"></i></button></div>
<p><strong>Observé :</strong> rien ne se passe à l’apparition du fichier <code>.tmp</code> ; la ligne est affichée à l’instant où le renommage crée le nom <code>.msg</code>. Les deux formats acceptés fonctionnent, avec et sans horodatage final.</p>
<p>La leçon architecturale est celle que le tutoriel formule comme <code>producer → filesystem → consumer</code> : le consommateur n’a pas pu distinguer un humain tapant <code>mv</code> d’un véritable service. Il connaît sa propre boîte d’entrée, pas qui y écrit. L’égoïsme a survécu à la frontière de processus.</p>
<p>Le point architectural s’écrit <code>producer → filesystem → consumer</code> : le consommateur n’a pas pu distinguer un humain tapant <code>mv</code> d’un véritable service. Il connaît sa propre boîte d’entrée, pas qui y écrit. L’égoïsme a survécu à la frontière de processus.</p>
</section>
<section id="sec-steps-16-17" class="level2" data-number="3.5">
<h2 data-number="3.5" class="anchored" data-anchor-id="sec-steps-16-17"><span class="header-section-number">3.5</span> Étapes 16–17 — Services et médiateur deviennent des processus</h2>
@@ -457,8 +521,8 @@ TIMESTAMP: 2026-09-22T10:42:12.123Z</code></pre>
</tr>
</tbody>
</table>
<p>Le médiateur est générique : sa route n’est pas compilée en dur, elle arrive en deux arguments de démarrage. Mais le tutoriel signale une asymétrie à garder en tête : les trois capacités reçoivent leur <strong>travail</strong> sous forme de messages dans une boîte, tandis que le médiateur reçoit sa <strong>route</strong> comme configuration de démarrage, et il n’a ni nom ni boîte de contrôle propre où quelqu’un pourrait écrire.</p>
<p>Conséquence pratique : les arguments sont lus une seule fois, donc changer la route d’un médiateur en cours d’exécution exige de l’arrêter et de le relancer. Un fichier de configuration ne changerait rien — il est lui aussi lu au démarrage. Le tutoriel laisse volontairement ce point ouvert jusqu’à ce que le coût des médiateurs distribués ait été ressenti.</p>
<p>Le médiateur est générique : sa route n’est pas compilée en dur, elle arrive en deux arguments de démarrage. Mais une asymétrie mérite d’être gardée en tête : les trois capacités reçoivent leur <strong>travail</strong> sous forme de messages dans une boîte, tandis que le médiateur reçoit sa <strong>route</strong> comme configuration de démarrage, et il n’a ni nom ni boîte de contrôle propre où quelqu’un pourrait écrire.</p>
<p>Conséquence pratique : les arguments sont lus une seule fois, donc changer la route d’un médiateur en cours d’exécution exige de l’arrêter et de le relancer. Un fichier de configuration ne changerait rien — il est lui aussi lu au démarrage. Ce point reste volontairement ouvert jusqu’à ce que le coût des médiateurs distribués ait été ressenti.</p>
</section>
<section id="sec-step-18" class="level2" data-number="3.6">
<h2 data-number="3.6" class="anchored" data-anchor-id="sec-step-18"><span class="header-section-number">3.6</span> Étape 18 — Exécuter la version entièrement externe, en local</h2>
@@ -469,7 +533,7 @@ TIMESTAMP: 2026-09-22T10:42:12.123Z</code></pre>
<span id="cb6-4"><a href="#cb6-4" aria-hidden="true" tabindex="-1"></a><span class="ex">java</span> Mediator.java rot13/outbox consoleOut/inbox <span class="co"># terminal 4</span></span>
<span id="cb6-5"><a href="#cb6-5" aria-hidden="true" tabindex="-1"></a><span class="ex">java</span> ActuatorService.java <span class="co"># terminal 5</span></span></code></pre></div><button title="Copier vers le presse-papier" class="code-copy-button"><i class="bi"></i></button></div>
<p><strong>Observé :</strong> <code>Hello World</code> tapé dans le terminal 1 est apparu comme <code>Uryyb Jbeyq</code> dans le terminal 5. Les trois terminaux du milieu n’ont rien affiché de nouveau — chaque médiateur affiche une ligne « Mediating: … » au démarrage, et <code>ProcessorService</code> n’affiche rien du tout. Ensuite, chacun des quatre répertoires de boîtes contenait un fichier <code>.msg</code> : la même ligne, recopiée le long de la chaîne.</p>
<p>Comptons : <strong>cinq processus</strong> pour ce que l’étape 1 faisait en une instruction. La consigne du tutoriel à ce stade n’est pas d’optimiser : « We are not done making it painful. »</p>
<p>Comptons : <strong>cinq processus</strong> pour ce que l’étape 1 faisait en une instruction. Ce n’est pas le moment d’optimiser : ce n’est pas encore censé être confortable.</p>
<div id="fig-filesystem-processes" class="flow-figure quarto-float quarto-figure quarto-figure-center anchored">
<figure class="quarto-float quarto-float-fig figure">
<div aria-describedby="fig-filesystem-processes-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
@@ -1146,6 +1210,9 @@ Figure&nbsp;3.1: Les cinq processus et les quatre répertoires de boîtes. Dans
</a>
</div>
<div class="nav-page nav-page-next">
<a href="./glossary.html" class="pagination-link" aria-label="[Glossary]{.en}[Glossaire]{.fr}[Glossar]{.de}">
<span class="nav-page-text">Glossaire</span> <i class="bi bi-arrow-right-short"></i>
</a>
</div>
</nav>
</div> <!-- /content -->
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -152,5 +152,5 @@ svg:not(:has(.node)) .node { opacity: 1; }
<!-- who knows whom -->
<text class="t-sm" data-label="knows" x="14" y="176">main() les connaît tous les trois : leurs noms, les types d'arguments et de résultats, et le fait qu'ils sont disponibles immédiatement.</text>
<text class="t-mut" data-label="cost" x="14" y="202">Le câblage est écrit dans le code lui-même — étape 1 du tutoriel.</text>
<text class="t-mut" data-label="cost" x="14" y="202">Le câblage est écrit dans le code lui-même — étape 1.</text>
</svg>

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

File diff suppressed because it is too large. Load diff
+87 -66
View File
@@ -8,7 +8,7 @@
<meta name="author" content="Romain De Groote">
<title>De l’appel à l’événement</title>
<title>Contrôle de processus</title>
<style>
/* Default styles provided by pandoc.
** See https://pandoc.org/MANUAL.html#variables-for-html for config info.
@@ -27,41 +27,6 @@ ul.task-list li input[type="checkbox"] {
margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */
vertical-align: middle;
}
/* CSS for syntax highlighting */
html { -webkit-text-size-adjust: 100%; }
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
}
pre.numberSource { margin-left: 3em; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
</style>
@@ -85,9 +50,15 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<link href="site_libs/bootstrap/bootstrap-cfe7114cbc4adb2af5ff3a891545d7fa.min.css" rel="stylesheet" append-hash="true" id="quarto-bootstrap" data-mode="light">
<script src="site_libs/quarto-contrib/calc-exo-2.0.0/exo.js"></script>
<link href="site_libs/quarto-contrib/calc-exo-2.0.0/exo.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-quiz-1.0.0/quiz.js"></script>
<link href="site_libs/quarto-contrib/calc-quiz-1.0.0/quiz.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-further-1.0.0/further.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-latex-tables-1.0.0/latex-tables.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-notes-1.0.0/calc-notes.js"></script>
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/theme.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/high-contrast.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/calc-notes.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/narrow.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-glossary-2.0.0/glossary.js"></script>
<link href="site_libs/quarto-contrib/calc-glossary-2.0.0/glossary.css" rel="stylesheet">
<script id="quarto-search-options" type="application/json">{
@@ -130,7 +101,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
nothing is attached to the links themselves: one capture-phase listener on
the document reads the link's final address at click time.
If a language has not been built (./render-all.sh), its pages do not exist:
If a language has not been built, its pages do not exist:
the target is checked first and a short note is shown instead of a
"Not Found" page.
@@ -146,12 +117,9 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
var ROOT_LANG = 'en'; // the language at the top of _book/
var COOKIE = 'notes-lang';
var NOTE = {
de: 'Diese Sprache wurde noch nicht erstellt. Einmal ./render-all.sh ausführen – '
+ 'danach funktioniert der Wechsel auch in der Vorschau.',
fr: 'Cette langue n’a pas encore été générée. Lancez une fois ./render-all.sh : '
+ 'ensuite le changement fonctionne aussi dans l’aperçu.',
en: 'This language hasn’t been built yet. Run ./render-all.sh once, '
+ 'then switching works in the preview too.'
de: 'Diese Sprache ist hier noch nicht verfügbar.',
fr: 'Cette langue n’est pas encore disponible ici.',
en: 'This language is not available here yet.'
};
var here = (document.documentElement.lang || ROOT_LANG).slice(0, 2);
@@ -165,9 +133,20 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
var m = document.cookie.match(/(?:^|;\s*)notes-lang=(de|fr|en)(?:;|$)/);
return m ? m[1] : null;
}
// path '/' on purpose: every book of these notes is served from one host,
// each under its own folder, so a language picked in any of them is the
// language all of them open in. A book hosted on its own would be no worse
// off -- the cookie simply has nothing else to reach.
var COOKIE_PATH = '/';
function remember(code) {
document.cookie = COOKIE + '=' + code + '; path=' + root + '; max-age=31536000; SameSite=Lax'
document.cookie = COOKIE + '=' + code + '; path=' + COOKIE_PATH
+ '; max-age=31536000; SameSite=Lax'
+ (location.protocol === 'https:' ? '; Secure' : '');
// a copy written under the book's own path by an earlier version would be
// the more specific one and would shadow the shared cookie for good
if (root !== COOKIE_PATH) {
document.cookie = COOKIE + '=; path=' + root + '; max-age=0';
}
}
// a returning reader lands in the language picked last time
@@ -189,7 +168,11 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
box.style.cssText = 'position:fixed;left:50%;bottom:1.25rem;transform:translateX(-50%);'
+ 'max-width:min(34rem,calc(100vw - 2rem));padding:.6rem .9rem;border-radius:6px;'
+ 'background:#1f2328;color:#fff;font-size:.85rem;line-height:1.4;z-index:2000;'
+ 'box-shadow:0 4px 16px rgba(0,0,0,.25)';
// a status message, so it keeps its own dark surface in either mode; the
// hairline is the page's rule colour, invisible on a light page and an
// edge against a dark one, where the shadow alone no longer separates it
+ 'border:1px solid var(--calc-line,#444);'
+ 'box-shadow:0 4px 16px var(--calc-shadow,rgba(0,0,0,.25))';
document.body.appendChild(box);
setTimeout(function () { box.remove(); }, 7000);
}
@@ -230,7 +213,35 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
}, true);
})();
</script>
<style>:root { --calc-notecolor: #B45309; }</style>
<style>:root {
--calc-furthercolor-src: #6B3FA0;
--calc-furthercolor: var(--calc-furthercolor-src);
}</style>
<style>:root {
--calc-notecolor-src: #B45309;
--calc-notecolor: var(--calc-notecolor-src);
}</style>
<script>(function (e) {
var KEY = 'notes-contrast', forced = false;
var picked = null;
try { picked = localStorage.getItem(KEY); } catch (err) {}
var q = null;
try { q = window.matchMedia && window.matchMedia('(prefers-contrast: more)'); } catch (err) {}
if (picked === 'more' || (picked !== 'normal' && (forced || (q && q.matches)))) {
e.classList.add('hc');
}
if (q) {
var f = function () {
var p = null;
try { p = localStorage.getItem(KEY); } catch (err) {}
if (p === null) e.classList.toggle('hc', forced || q.matches);
};
if (q.addEventListener) q.addEventListener('change', f);
else if (q.addListener) q.addListener(f);
}
})(document.documentElement);</script>
</head>
@@ -259,7 +270,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<nav id="quarto-sidebar" class="sidebar collapse collapse-horizontal quarto-sidebar-collapse-item sidebar-navigation docked overflow-auto">
<div class="pt-lg-2 mt-2 text-left sidebar-header">
<div class="sidebar-title mb-0 py-0">
<a href="./">De l’appel à l’événement</a>
<a href="./">Contrôle de processus</a>
<div class="sidebar-tools-main tools-wide">
<div class="dropdown">
<a href="" title="" id="quarto-navigation-tool-dropdown-0" class="quarto-navigation-tool dropdown-toggle px-1" data-bs-toggle="dropdown" aria-expanded="false" role="link" aria-label=""><i class="bi bi-translate"></i></a>
@@ -281,7 +292,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
</li>
</ul>
</div>
<a href="./De-l-appel-à-l-événement.pdf" title="Download PDF" class="quarto-navigation-tool px-1" aria-label="Download PDF"><i class="bi bi-file-pdf"></i></a>
<a href="./Contrôle-de-processus.pdf" title="Download PDF" class="quarto-navigation-tool px-1" aria-label="Download PDF"><i class="bi bi-file-pdf"></i></a>
<a href="" class="quarto-reader-toggle quarto-navigation-tool px-1" onclick="window.quartoToggleReader(); return false;" title="Basculer en mode lecteur">
<div class="quarto-reader-toggle-btn">
<i class="bi"></i>
@@ -306,7 +317,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./00-orientation.html" class="sidebar-item-text sidebar-link">
<span class="menu-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Étape 0 — De quoi parle le tutoriel</span></span></a>
<span class="menu-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Étape 0 — De quoi il s’agit</span></span></a>
</div>
</li>
<li class="sidebar-item">
@@ -320,6 +331,23 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<a href="./02-part-ii-processes.html" class="sidebar-item-text sidebar-link">
<span class="menu-text"><span class="chapter-number">3</span>&nbsp; <span class="chapter-title">Partie II — Franchir la frontière de processus</span></span></a>
</div>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a class="sidebar-item-text sidebar-link text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" role="navigation" aria-expanded="false">
<span class="menu-text">Annexes</span></a>
<a class="sidebar-item-toggle text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" role="navigation" aria-expanded="false" aria-label="Basculer la section">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-1" class="collapse list-unstyled sidebar-section depth1 ">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./glossary.html" class="sidebar-item-text sidebar-link">
<span class="menu-text">Glossaire</span></a>
</div>
</li>
</ul>
</li>
</ul>
</div>
@@ -334,7 +362,6 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<li><a href="#sec-about" id="toc-sec-about" class="nav-link active" data-scroll-target="#sec-about">À propos de ces notes</a>
<ul class="collapse">
<li><a href="#sec-diagrams" id="toc-sec-diagrams" class="nav-link" data-scroll-target="#sec-diagrams">Comment lire les figures</a></li>
<li><a href="#sec-build" id="toc-sec-build" class="nav-link" data-scroll-target="#sec-build">Construire ce livre</a></li>
</ul></li>
</ul>
</nav>
@@ -344,7 +371,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<header id="title-block-header" class="quarto-title-block default">
<div class="quarto-title">
<h1 class="title">De l’appel à l’événement</h1>
<h1 class="title">Contrôle de processus</h1>
</div>
@@ -361,7 +388,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<div>
<div class="quarto-title-meta-heading">Date de publication</div>
<div class="quarto-title-meta-contents">
<p class="date">24 septembre 2026</p>
<p class="date">25 septembre 2026</p>
</div>
</div>
@@ -371,7 +398,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<div>
<div class="abstract">
<div class="block-title">Résumé</div>
Résumés pas à pas du tutoriel SIN.04028 « From Calling to Eventing », de l’appel de méthode direct à une architecture événementielle sur MQTT. Process Control, donné par Reto Konig, Université de Fribourg, semestre d’automne 2026.
Un petit programme, reconstruit pas à pas de l’appel de méthode direct à une architecture événementielle sur MQTT : ce qui bouge à chaque étape, et qui finit par connaître qui.
</div>
</div>
@@ -394,34 +421,28 @@ MULTILINGUAL (see _extensions/notes/i18n.lua):
picture, just still.
- fixed section ids (#sec-...) so anchors are identical in all three books.
English is the verified source: the tutorial being summarised is written in
English. French and German are translations of it.
English is the verified source: the material these notes are built from is
written in English. French and German are translations of it.
Code identifiers, mailbox and topic names, file names, commands and protocol
terms are never translated (consoleIn.outbox, rot13/inbox, WatchService,
Mediator.java, .msg, put/take, Intent/Status/Event).
-->
<p>Ces notes résument le tutoriel <strong>« SIN.04028 — From Calling to Eventing »</strong>, parcouru étape par étape. Le tutoriel lui-même se trouve à côté de ce livre, dans <code>SIN.04028-From-Calling-to-Eventing/README.md</code>, et fait partie du cours <em>Process Control</em> donné par Reto Konig à l’Université de Fribourg (semestre d’automne 2026).</p>
<p>Ces notes suivent un petit programme à travers une longue série de reconstructions, de l’appel de méthode direct à une architecture événementielle sur MQTT. Chaque reconstruction laisse le programme faire exactement ce qu’il faisait avant, et change qui connaît qui.</p>
<p>Le programme construit ne change jamais : vous tapez une ligne, elle revient décalée de 13 lettres.</p>
<pre class="text"><code>keyboard → ROT13 → console</code></pre>
<p>Ce qui change, c’est tout ce qui l’entoure. Le tutoriel reconstruit le même système encore et encore en posant trois questions, dans cet ordre :</p>
<p>Ce qui change, c’est tout ce qui l’entoure. Le même système est reconstruit encore et encore, et chaque reconstruction pose trois questions, dans cet ordre :</p>
<blockquote class="blockquote">
<p><strong>Qui connaît qui ?</strong></p>
<p><strong>Qui possède quoi ?</strong></p>
<p><strong>Qui décide comment le système est câblé ?</strong></p>
</blockquote>
<p>Un résumé est ajouté ici chaque fois qu’une étape est terminée : le livre grandit donc au rythme du travail. Chaque résumé dit ce que l’étape a fait, ce qui a été observé à l’exécution, et ce qui a bougé sur le plan architectural — en général une connaissance qui a changé de mains.</p>
<p><em>D’après le matériel de Reto Konig, Université de Fribourg.</em></p>
<section id="sec-diagrams" class="level2">
<h2 class="anchored" data-anchor-id="sec-diagrams">Comment lire les figures</h2>
<p>Chaque figure existe une fois comme dessin et trois fois comme langue. Dans la version web, une figure qui porte un flux de messages possède une petite barre de lecture : <strong>Lancer</strong> fait parcourir toute la chaîne à un message, <strong>Un saut</strong> avance d’une seule étape, et <strong>Réinitialiser</strong> remet tout à zéro. Les boîtes s’allument au passage du message : on voit ainsi quel composant attend et lequel travaille.</p>
<p>Dans le PDF, et dans un navigateur sans JavaScript, la même image est là — simplement immobile. Rien dans ces notes ne dépend de l’animation.</p>
</section>
<section id="sec-build" class="level2">
<h2 class="anchored" data-anchor-id="sec-build">Construire ce livre</h2>
<p>Les trois livres proviennent d’une source unique :</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./render-all.sh</span> <span class="co"># figures, puis html + pdf pour en, fr, de</span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./render-all.sh</span> <span class="at">--serve</span> <span class="co"># …puis sert _book/ sur http://localhost:8000</span></span></code></pre></div><button title="Copier vers le presse-papier" class="code-copy-button"><i class="bi"></i></button></div>
<p><code>_book/</code> contient le livre anglais, <code>_book/fr/</code> le français et <code>_book/de/</code> l’allemand ; le menu de langue dans la barre latérale passe de l’un à l’autre et retient le choix. Un simple <code>quarto render</code> ne construit que l’anglais et vide <code>_book/</code>, ce qui supprime les deux autres — utilisez donc le script.</p>
</section>
@@ -1051,8 +1072,8 @@ Mediator.java, .msg, put/take, Intent/Status/Event).
<div class="nav-page nav-page-previous">
</div>
<div class="nav-page nav-page-next">
<a href="./00-orientation.html" class="pagination-link" aria-label="[Step 0 — What the tutorial is about]{.en}[Étape 0 — De quoi parle le tutoriel]{.fr}[Schritt 0 — Worum es im Tutorial geht]{.de}">
<span class="nav-page-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Étape 0 — De quoi parle le tutoriel</span></span> <i class="bi bi-arrow-right-short"></i>
<a href="./00-orientation.html" class="pagination-link" aria-label="[Step 0 — What this is about]{.en}[Étape 0 — De quoi il s'agit]{.fr}[Schritt 0 — Worum es geht]{.de}">
<span class="nav-page-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Étape 0 — De quoi il s’agit</span></span> <i class="bi bi-arrow-right-short"></i>
</a>
</div>
</nav>
+31 -30
View File
@@ -2,9 +2,9 @@
{
"objectID": "index.html",
"href": "index.html",
"title": "De l’appel à l’événement",
"title": "Contrôle de processus",
"section": "",
"text": "À propos de ces notes\nCes notes résument le tutoriel « SIN.04028 — From Calling to Eventing », parcouru étape par étape. Le tutoriel lui-même se trouve à côté de ce livre, dans SIN.04028-From-Calling-to-Eventing/README.md, et fait partie du cours Process Control donné par Reto Konig à l’Université de Fribourg (semestre d’automne 2026).\nLe programme construit ne change jamais : vous tapez une ligne, elle revient décalée de 13 lettres.\nCe qui change, c’est tout ce qui l’entoure. Le tutoriel reconstruit le même système encore et encore en posant trois questions, dans cet ordre :\nUn résumé est ajouté ici chaque fois qu’une étape est terminée : le livre grandit donc au rythme du travail. Chaque résumé dit ce que l’étape a fait, ce qui a été observé à l’exécution, et ce qui a bougé sur le plan architectural — en général une connaissance qui a changé de mains.",
"text": "À propos de ces notes\nCes notes suivent un petit programme à travers une longue série de reconstructions, de l’appel de méthode direct à une architecture événementielle sur MQTT. Chaque reconstruction laisse le programme faire exactement ce qu’il faisait avant, et change qui connaît qui.\nLe programme construit ne change jamais : vous tapez une ligne, elle revient décalée de 13 lettres.\nCe qui change, c’est tout ce qui l’entoure. Le même système est reconstruit encore et encore, et chaque reconstruction pose trois questions, dans cet ordre :\nUn résumé est ajouté ici chaque fois qu’une étape est terminée : le livre grandit donc au rythme du travail. Chaque résumé dit ce que l’étape a fait, ce qui a été observé à l’exécution, et ce qui a bougé sur le plan architectural — en général une connaissance qui a changé de mains.\nD’après le matériel de Reto Konig, Université de Fribourg.",
"crumbs": [
"[About these notes]{.en}[À propos de ces notes]{.fr}[Über diese Notizen]{.de}"
]
@@ -12,41 +12,31 @@
{
"objectID": "index.html#sec-diagrams",
"href": "index.html#sec-diagrams",
"title": "De l’appel à l’événement",
"title": "Contrôle de processus",
"section": "Comment lire les figures",
"text": "Comment lire les figures\nChaque figure existe une fois comme dessin et trois fois comme langue. Dans la version web, une figure qui porte un flux de messages possède une petite barre de lecture : Lancer fait parcourir toute la chaîne à un message, Un saut avance d’une seule étape, et Réinitialiser remet tout à zéro. Les boîtes s’allument au passage du message : on voit ainsi quel composant attend et lequel travaille.\nDans le PDF, et dans un navigateur sans JavaScript, la même image est là — simplement immobile. Rien dans ces notes ne dépend de l’animation.",
"crumbs": [
"[About these notes]{.en}[À propos de ces notes]{.fr}[Über diese Notizen]{.de}"
]
},
{
"objectID": "index.html#sec-build",
"href": "index.html#sec-build",
"title": "De l’appel à l’événement",
"section": "Construire ce livre",
"text": "Construire ce livre\nLes trois livres proviennent d’une source unique :\n./render-all.sh # figures, puis html + pdf pour en, fr, de\n./render-all.sh --serve # …puis sert _book/ sur http://localhost:8000\n_book/ contient le livre anglais, _book/fr/ le français et _book/de/ l’allemand ; le menu de langue dans la barre latérale passe de l’un à l’autre et retient le choix. Un simple quarto render ne construit que l’anglais et vide _book/, ce qui supprime les deux autres — utilisez donc le script.",
"crumbs": [
"[About these notes]{.en}[À propos de ces notes]{.fr}[Über diese Notizen]{.de}"
]
},
{
"objectID": "00-orientation.html",
"href": "00-orientation.html",
"title": "1  Étape 0 — De quoi parle le tutoriel",
"title": "1  Étape 0 — De quoi il s’agit",
"section": "",
"text": "1.1 Les trois questions\nL’étape 0 ne contient aucun code. Elle énonce le sujet : non pas ROT13, mais l’architecture autour de lui. La fonctionnalité reste presque inchangée pendant 81 étapes, et c’est précisément ce qui rend visibles les changements alentour.\nDeux règles sont posées ici et valent pour tout le tutoriel :\nC’est pourquoi le tutoriel ne commence ni par MQTT, ni par les abonnements dynamiques. Il construit d’abord un système aux médiateurs délibérément maladroits, le met en service, et demande seulement ensuite s’ils ont mérité leur place.\nLa seconde règle concerne le vocabulaire : Intent, Status/State et Event ne sont nommés qu’après avoir été utilisés. Ils apparaissent vers l’étape 42, pas avant.\nL’itinéraire prévu, dès l’étape 0 :\nLa formulation des trois questions compte, et il est facile de la remplacer par une version plus faible :\n« Connaître » n’est pas « communiquer » : deux composants peuvent échanger des messages toute la journée sans que l’un nomme l’autre. « Décider du câblage » n’est pas « relier » : la partie qui transmet les messages n’est pas forcément celle qui a choisi la route. Les deux distinctions deviennent concrètes plus tard — la première dès l’étape 1, la seconde dans la partie III.",
"text": "1.1 Les trois questions\nL’étape 0 ne contient aucun code. Elle énonce le sujet : non pas ROT13, mais l’architecture autour de lui. La fonctionnalité reste presque inchangée pendant 81 étapes, et c’est précisément ce qui rend visibles les changements alentour.\nDeux règles sont posées ici et valent jusqu’au bout :\nC’est pourquoi la construction ne commence ni par MQTT, ni par les abonnements dynamiques. Un système aux médiateurs délibérément maladroits est bâti d’abord, mis en service, et l’on demande seulement ensuite s’ils ont mérité leur place.\nLa seconde règle concerne le vocabulaire : Intent, Status/State et Event ne sont nommés qu’après avoir été utilisés. Ils apparaissent vers l’étape 42, pas avant.\nL’itinéraire prévu, dès l’étape 0 :\nLa formulation des trois questions compte, et il est facile de la remplacer par une version plus faible :\n« Connaître » n’est pas « communiquer » : deux composants peuvent échanger des messages toute la journée sans que l’un nomme l’autre. « Décider du câblage » n’est pas « relier » : la partie qui transmet les messages n’est pas forcément celle qui a choisi la route. Les deux distinctions deviennent concrètes plus tard — la première dès l’étape 1, la seconde dans la partie III.",
"crumbs": [
"<span class='chapter-number'>1</span>  <span class='chapter-title'>[Step 0 — What the tutorial is about]{.en}[Étape 0 — De quoi parle le tutoriel]{.fr}[Schritt 0 — Worum es im Tutorial geht]{.de}</span>"
"<span class='chapter-number'>1</span>  <span class='chapter-title'>[Step 0 — What this is about]{.en}[Étape 0 — De quoi il s'agit]{.fr}[Schritt 0 — Worum es geht]{.de}</span>"
]
},
{
"objectID": "00-orientation.html#sec-three-questions",
"href": "00-orientation.html#sec-three-questions",
"title": "1  Étape 0 — De quoi parle le tutoriel",
"title": "1  Étape 0 — De quoi il s’agit",
"section": "",
"text": "Ce que demande le tutoriel\nUne version plus faible\n\n\n\n\nQui connaît qui ?\nqui communique avec qui\n\n\nQui possède quoi ?\nquelles données détient chaque partie\n\n\nQui décide du câblage ?\nquelle partie relie le tout",
"text": "Telle qu’elle est posée ici\nUne version plus faible\n\n\n\n\nQui connaît qui ?\nqui communique avec qui\n\n\nQui possède quoi ?\nquelles données détient chaque partie\n\n\nQui décide du câblage ?\nquelle partie relie le tout",
"crumbs": [
"<span class='chapter-number'>1</span>  <span class='chapter-title'>[Step 0 — What the tutorial is about]{.en}[Étape 0 — De quoi parle le tutoriel]{.fr}[Schritt 0 — Worum es im Tutorial geht]{.de}</span>"
"<span class='chapter-number'>1</span>  <span class='chapter-title'>[Step 0 — What this is about]{.en}[Étape 0 — De quoi il s'agit]{.fr}[Schritt 0 — Worum es geht]{.de}</span>"
]
},
{
@@ -74,7 +64,7 @@
"href": "01-part-i-calls.html#sec-step-2",
"title": "2  Partie I — Commencer par ce que l’on connaît déjà",
"section": "2.2 Étape 2 — Trois capacités égoïstes",
"text": "2.2 Étape 2 — Trois capacités égoïstes\nUn composant égoïste dit : je sais ce que je peux faire, quelles données j’accepte et quelles données je produis — et je préfère ne pas connaître le processus métier qui m’entoure. Concrètement, ConsoleIn ne doit pas contenir rot13(...), et ROT13 ne doit pas contenir consoleOut(...).\nSupprimer ces appels crée aussitôt un problème, que le tutoriel formule en question : si personne ne connaît personne, qui fait de cela un système ? Notez ce que la question ne dit pas : la connaissance n’a pas disparu, elle doit aller ailleurs. Il manque deux liaisons, pas une — ConsoleIn ↔︎ ROT13 et ROT13 ↔︎ ConsoleOut.",
"text": "2.2 Étape 2 — Trois capacités égoïstes\nUn composant égoïste dit : je sais ce que je peux faire, quelles données j’accepte et quelles données je produis — et je préfère ne pas connaître le processus métier qui m’entoure. Concrètement, ConsoleIn ne doit pas contenir rot13(...), et ROT13 ne doit pas contenir consoleOut(...).\nSupprimer ces appels crée aussitôt un problème, qui se pose en question : si personne ne connaît personne, qui fait de cela un système ? Notez ce que la question ne dit pas : la connaissance n’a pas disparu, elle doit aller ailleurs. Il manque deux liaisons, pas une — ConsoleIn ↔︎ ROT13 et ROT13 ↔︎ ConsoleOut.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
@@ -84,7 +74,7 @@
"href": "01-part-i-calls.html#sec-step-3",
"title": "2  Partie I — Commencer par ce que l’on connaît déjà",
"section": "2.3 Étape 3 — Donner une boîte aux lettres à chaque capacité",
"text": "2.3 Étape 3 — Donner une boîte aux lettres à chaque capacité\nLe plus petit mécanisme pour les liaisons manquantes : un message et une file nommée.\nrecord Message(String type, String value) {}\n\nMap&lt;String, BlockingQueue&lt;Message&gt;&gt; mailboxes = new ConcurrentHashMap&lt;&gt;();\n\nBlockingQueue&lt;Message&gt; mailbox(String name) {\n return mailboxes.computeIfAbsent(name, _ -&gt; new LinkedBlockingQueue&lt;&gt;());\n}\nLe tutoriel insiste pour appeler cela des boîtes aux lettres (mailboxes) et non des sujets (topics), et il en donne la raison : si deux lecteurs appellent take() sur la même boîte, ils sont en concurrence — chaque message va à un seul d’entre eux et n’est pas copié aux deux. Un topic, en Publish/Subscribe, remettrait à chaque abonné sa propre copie. Un lecteur par message suffit pour l’instant, et la limitation est conservée volontairement : c’est elle qui rendra visible plus tard ce que Publish/Subscribe apporte réellement.",
"text": "2.3 Étape 3 — Donner une boîte aux lettres à chaque capacité\nLe plus petit mécanisme pour les liaisons manquantes : un message et une file nommée.\nrecord Message(String type, String value) {}\n\nMap&lt;String, BlockingQueue&lt;Message&gt;&gt; mailboxes = new ConcurrentHashMap&lt;&gt;();\n\nBlockingQueue&lt;Message&gt; mailbox(String name) {\n return mailboxes.computeIfAbsent(name, _ -&gt; new LinkedBlockingQueue&lt;&gt;());\n}\nCe sont des boîtes aux lettres (mailboxes) et non des sujets (topics), et la distinction mérite qu’on y insiste : si deux lecteurs appellent take() sur la même boîte, ils sont en concurrence — chaque message va à un seul d’entre eux et n’est pas copié aux deux. Un topic, en Publish/Subscribe, remettrait à chaque abonné sa propre copie. Un lecteur par message suffit pour l’instant, et la limitation est conservée volontairement : c’est elle qui rendra visible plus tard ce que Publish/Subscribe apporte réellement.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
@@ -94,7 +84,7 @@
"href": "01-part-i-calls.html#sec-steps-4-6",
"title": "2  Partie I — Commencer par ce que l’on connaît déjà",
"section": "2.4 Étapes 4–6 — Les trois capacités deviennent égoïstes",
"text": "2.4 Étapes 4–6 — Les trois capacités deviennent égoïstes\nChaque capacité ne touche plus que ses propres noms de boîtes :\n\n\n\nCapacité\nlit\nécrit\n\n\n\n\nConsoleIn\nle clavier\nconsoleIn.outbox\n\n\nROT13\nrot13.inbox\nrot13.outbox\n\n\nConsoleOut\nconsoleOut.inbox\nla console\n\n\n\nAucune capacité ne contient le nom d’une autre. Le résumé du tutoriel lui-même : « trois capacités bien isolées. Et elles ne font absolument rien ensemble. » Rien ne déplace un message de consoleIn.outbox vers rot13.inbox, ni de rot13.outbox vers consoleOut.inbox.",
"text": "2.4 Étapes 4–6 — Les trois capacités deviennent égoïstes\nChaque capacité ne touche plus que ses propres noms de boîtes :\n\n\n\nCapacité\nlit\nécrit\n\n\n\n\nConsoleIn\nle clavier\nconsoleIn.outbox\n\n\nROT13\nrot13.inbox\nrot13.outbox\n\n\nConsoleOut\nconsoleOut.inbox\nla console\n\n\n\nAucune capacité ne contient le nom d’une autre, et c’est exactement le résultat : trois capacités bien isolées qui ne font absolument rien ensemble. Rien ne déplace un message de consoleIn.outbox vers rot13.inbox, ni de rot13.outbox vers consoleOut.inbox.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
@@ -114,7 +104,7 @@
"href": "01-part-i-calls.html#sec-step-8",
"title": "2  Partie I — Commencer par ce que l’on connaît déjà",
"section": "2.6 Étape 8 — Redemander : qui connaît qui ?",
"text": "2.6 Étape 8 — Redemander : qui connaît qui ?\nConsoleIn connaît-il ROT13 ? Non. ROT13 connaît-il ConsoleIn ou ConsoleOut ? Non. La topologie a-t-elle disparu ? Non — elle se trouve dans les deux appels mediate(...) à l’intérieur de main().\nC’est le premier résultat majeur du tutoriel :\n\nLe découplage ne fait souvent pas disparaître la connaissance. Il la déplace là où elle appartient.\n\nLa capacité « ROT13 transforme du texte » appartient à ROT13. La topologie ConsoleIn → ROT13 → ConsoleOut appartient à la composition du système. Ce qui a changé depuis l’étape 1, ce n’est pas que le câblage a quitté main() — il y est toujours — mais qu’il n’est plus écrit à l’intérieur d’une capacité. C’est désormais une donnée : deux paires de noms de boîtes. Recâbler touche ces deux lignes et aucune capacité.",
"text": "2.6 Étape 8 — Redemander : qui connaît qui ?\nConsoleIn connaît-il ROT13 ? Non. ROT13 connaît-il ConsoleIn ou ConsoleOut ? Non. La topologie a-t-elle disparu ? Non — elle se trouve dans les deux appels mediate(...) à l’intérieur de main().\nC’est le premier résultat majeur :\n\nLe découplage ne fait souvent pas disparaître la connaissance. Il la déplace là où elle appartient.\n\nLa capacité « ROT13 transforme du texte » appartient à ROT13. La topologie ConsoleIn → ROT13 → ConsoleOut appartient à la composition du système. Ce qui a changé depuis l’étape 1, ce n’est pas que le câblage a quitté main() — il y est toujours — mais qu’il n’est plus écrit à l’intérieur d’une capacité. C’est désormais une donnée : deux paires de noms de boîtes. Recâbler touche ces deux lignes et aucune capacité.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
@@ -124,7 +114,7 @@
"href": "01-part-i-calls.html#sec-step-9",
"title": "2  Partie I — Commencer par ce que l’on connaît déjà",
"section": "2.7 Étape 9 — Pourquoi des threads virtuels ?",
"text": "2.7 Étape 9 — Pourquoi des threads virtuels ?\nCinq boucles attendent désormais indéfiniment : le clavier, rot13.inbox, consoleOut.inbox et les sources des deux médiateurs. Les threads virtuels sont simplement le moyen Java peu coûteux de faire attendre cinq choses à la fois dans une seule JVM.\nC’est une commodité d’implémentation, pas une architecture. L’architecture — qui connaît qui, et où vit le câblage — réside dans les noms de boîtes, pas dans les threads. La preuve que donne le tutoriel : la même architecture tournera en processus séparés à l’étape 11, sans aucun thread partagé entre les parties.",
"text": "2.7 Étape 9 — Pourquoi des threads virtuels ?\nCinq boucles attendent désormais indéfiniment : le clavier, rot13.inbox, consoleOut.inbox et les sources des deux médiateurs. Les threads virtuels sont simplement le moyen Java peu coûteux de faire attendre cinq choses à la fois dans une seule JVM.\nC’est une commodité d’implémentation, pas une architecture. L’architecture — qui connaît qui, et où vit le câblage — réside dans les noms de boîtes, pas dans les threads. La preuve de cette séparation : la même architecture tournera en processus séparés à l’étape 11, sans aucun thread partagé entre les parties.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
@@ -134,7 +124,7 @@
"href": "01-part-i-calls.html#sec-step-10",
"title": "2  Partie I — Commencer par ce que l’on connaît déjà",
"section": "2.8 Étape 10 — Garder les services égoïstes",
"text": "2.8 Étape 10 — Garder les services égoïstes\nLe raccourci évident : le premier médiateur ne fait que recopier les messages tels quels, alors pourquoi ne pas le supprimer et laisser ROT13 faire take() directement sur consoleIn.outbox ?\nParce que ROT13 contiendrait alors le nom consoleIn.outbox, c’est-à-dire qu’il saurait que ConsoleIn existe et où il publie. La topologie entrerait dans ROT13, et ROT13 cesserait d’être une capacité égoïste. Le test qui rend cela concret : supposons que l’entrée vienne d’une nouvelle capacité FileIn publiant dans fileIn.outbox.\n\n\n\n\n\n\n\n\n\navec le médiateur\navec le raccourci\n\n\n\n\nce qui change\nun argument du médiateur\nrunRot13 lui-même\n\n\nqui est touché\naucune capacité\nROT13, dont le travail n’a pas changé\n\n\n\nLe tutoriel est honnête sur le prix : ce design « peut sembler indirect — voire un peu bizarre », et il promet une autre manière de garder les services égoïstes sans médiateur sur le chemin de chaque message.",
"text": "2.8 Étape 10 — Garder les services égoïstes\nLe raccourci évident : le premier médiateur ne fait que recopier les messages tels quels, alors pourquoi ne pas le supprimer et laisser ROT13 faire take() directement sur consoleIn.outbox ?\nParce que ROT13 contiendrait alors le nom consoleIn.outbox, c’est-à-dire qu’il saurait que ConsoleIn existe et où il publie. La topologie entrerait dans ROT13, et ROT13 cesserait d’être une capacité égoïste. Le test qui rend cela concret : supposons que l’entrée vienne d’une nouvelle capacité FileIn publiant dans fileIn.outbox.\n\n\n\n\n\n\n\n\n\navec le médiateur\navec le raccourci\n\n\n\n\nce qui change\nun argument du médiateur\nrunRot13 lui-même\n\n\nqui est touché\naucune capacité\nROT13, dont le travail n’a pas changé\n\n\n\nLe prix mérite d’être dit clairement : ce design peut sembler indirect — voire un peu bizarre. Il existe une autre manière de garder les services égoïstes sans médiateur sur le chemin de chaque message ; elle viendra plus tard.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
@@ -144,7 +134,7 @@
"href": "01-part-i-calls.html#sec-part-i-result",
"title": "2  Partie I — Commencer par ce que l’on connaît déjà",
"section": "2.9 Ce que la partie I a déplacé",
"text": "2.9 Ce que la partie I a déplacé\n\n\n\n\n\n\n\n\nétape\noù vit la topologie\nqui peut recâbler\n\n\n\n\nétape 1\ndans le code de la capacité (IO.println(rot13(text)))\ncelui qui édite ce code\n\n\nétapes 7–8\ndans main(), en paires de noms de boîtes\ncelui qui édite main()\n\n\n\nFonctionnalité : inchangée. Lignes de code : davantage. Parties qui se connaissent : aucune. C’est le compromis que le reste du tutoriel continue de mettre à l’épreuve.",
"text": "2.9 Ce que la partie I a déplacé\n\n\n\n\n\n\n\n\nétape\noù vit la topologie\nqui peut recâbler\n\n\n\n\nétape 1\ndans le code de la capacité (IO.println(rot13(text)))\ncelui qui édite ce code\n\n\nétapes 7–8\ndans main(), en paires de noms de boîtes\ncelui qui édite main()\n\n\n\nFonctionnalité : inchangée. Lignes de code : davantage. Parties qui se connaissent : aucune. C’est le compromis que tout ce qui suit continue de mettre à l’épreuve.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
@@ -154,7 +144,7 @@
"href": "02-part-ii-processes.html",
"title": "3  Partie II — Franchir la frontière de processus",
"section": "",
"text": "3.1 Étape 11 — Séparer les composants\nLes étapes 11 à 18 reprennent l’architecture de la partie I et la répartissent sur cinq processus du système d’exploitation, sur un seul ordinateur. Les capacités gardent leurs noms de boîtes ; seul le transport en dessous change, des objets Java vers des fichiers dans des répertoires. Le premier problème réellement distribué apparaît ici, et il n’a rien à voir avec ROT13.\nTrois processus ne peuvent pas partager une BlockingQueue : chaque commande java démarre sa propre JVM avec sa propre mémoire, la carte mailboxes existerait donc en trois exemplaires et chacun ne verrait que ses propres messages. Il faut un transport externe.\nTCP conviendrait, MQTT conviendrait. Le tutoriel choisit délibérément l’option la plus primitive, le système de fichiers, avec une raison en une ligne : parce qu’on peut le voir. Les messages deviennent des fichiers que l’on peut lister avec ls et lire avec cat pendant que le système tourne. Primitif ne veut pas dire inférieur : la partie VIII revient sur ce que le système de fichiers fait vraiment bien et vraiment mal.",
"text": "3.1 Étape 11 — Séparer les composants\nLes étapes 11 à 18 reprennent l’architecture de la partie I et la répartissent sur cinq processus du système d’exploitation, sur un seul ordinateur. Les capacités gardent leurs noms de boîtes ; seul le transport en dessous change, des objets Java vers des fichiers dans des répertoires. Le premier problème réellement distribué apparaît ici, et il n’a rien à voir avec ROT13.\nTrois processus ne peuvent pas partager une BlockingQueue : chaque commande java démarre sa propre JVM avec sa propre mémoire, la carte mailboxes existerait donc en trois exemplaires et chacun ne verrait que ses propres messages. Il faut un transport externe.\nTCP conviendrait, MQTT conviendrait. C’est délibérément l’option la plus primitive qui est choisie, le système de fichiers, pour une raison en une ligne : parce qu’on peut le voir. Les messages deviennent des fichiers que l’on peut lister avec ls et lire avec cat pendant que le système tourne. Primitif ne veut pas dire inférieur : la partie VIII revient sur ce que le système de fichiers fait vraiment bien et vraiment mal.",
"crumbs": [
"<span class='chapter-number'>3</span>  <span class='chapter-title'>[Part II — Cross the process boundary]{.en}[Partie II — Franchir la frontière de processus]{.fr}[Teil II — Die Prozessgrenze überschreiten]{.de}</span>"
]
@@ -184,7 +174,7 @@
"href": "02-part-ii-processes.html#sec-step-15",
"title": "3  Partie II — Franchir la frontière de processus",
"section": "3.4 Étape 15 — Observer une boîte avec WatchService",
"text": "3.4 Étape 15 — Observer une boîte avec WatchService\nL’observateur de système de fichiers de Java fournit la moitié consommateur : enregistrer un répertoire pour ENTRY_CREATE, se bloquer dans watcher.take(), et ignorer tout nom de fichier qui ne finit pas par .msg.\nCela donne aussi un outil d’injection très rudimentaire. Avec ActuatorService lancé comme consommateur :\nprintf 'TEXT\\nHello from a file' &gt; messageBoard/consoleOut/inbox/manual.tmp\nmv messageBoard/consoleOut/inbox/manual.tmp messageBoard/consoleOut/inbox/manual.msg\nObservé : rien ne se passe à l’apparition du fichier .tmp ; la ligne est affichée à l’instant où le renommage crée le nom .msg. Les deux formats acceptés fonctionnent, avec et sans horodatage final.\nLa leçon architecturale est celle que le tutoriel formule comme producer → filesystem → consumer : le consommateur n’a pas pu distinguer un humain tapant mv d’un véritable service. Il connaît sa propre boîte d’entrée, pas qui y écrit. L’égoïsme a survécu à la frontière de processus.",
"text": "3.4 Étape 15 — Observer une boîte avec WatchService\nL’observateur de système de fichiers de Java fournit la moitié consommateur : enregistrer un répertoire pour ENTRY_CREATE, se bloquer dans watcher.take(), et ignorer tout nom de fichier qui ne finit pas par .msg.\nCela donne aussi un outil d’injection très rudimentaire. Avec ActuatorService lancé comme consommateur :\nprintf 'TEXT\\nHello from a file' &gt; messageBoard/consoleOut/inbox/manual.tmp\nmv messageBoard/consoleOut/inbox/manual.tmp messageBoard/consoleOut/inbox/manual.msg\nObservé : rien ne se passe à l’apparition du fichier .tmp ; la ligne est affichée à l’instant où le renommage crée le nom .msg. Les deux formats acceptés fonctionnent, avec et sans horodatage final.\nLe point architectural s’écrit producer → filesystem → consumer : le consommateur n’a pas pu distinguer un humain tapant mv d’un véritable service. Il connaît sa propre boîte d’entrée, pas qui y écrit. L’égoïsme a survécu à la frontière de processus.",
"crumbs": [
"<span class='chapter-number'>3</span>  <span class='chapter-title'>[Part II — Cross the process boundary]{.en}[Partie II — Franchir la frontière de processus]{.fr}[Teil II — Die Prozessgrenze überschreiten]{.de}</span>"
]
@@ -194,7 +184,7 @@
"href": "02-part-ii-processes.html#sec-steps-16-17",
"title": "3  Partie II — Franchir la frontière de processus",
"section": "3.5 Étapes 16–17 — Services et médiateur deviennent des processus",
"text": "3.5 Étapes 16–17 — Services et médiateur deviennent des processus\nLes trois capacités deviennent trois programmes, et le médiateur un quatrième type de programme :\n\n\n\n\n\n\n\n\n\nprogramme\njoue\nlit\nécrit\n\n\n\n\nSensorService.java\nConsoleIn\nle clavier\nconsoleIn/outbox\n\n\nProcessorService.java\nROT13\nrot13/inbox\nrot13/outbox\n\n\nActuatorService.java\nConsoleOut\nconsoleOut/inbox\nla console\n\n\nMediator.java &lt;from&gt; &lt;to&gt;\nla colle\n&lt;from&gt;\n&lt;to&gt;\n\n\n\nLe médiateur est générique : sa route n’est pas compilée en dur, elle arrive en deux arguments de démarrage. Mais le tutoriel signale une asymétrie à garder en tête : les trois capacités reçoivent leur travail sous forme de messages dans une boîte, tandis que le médiateur reçoit sa route comme configuration de démarrage, et il n’a ni nom ni boîte de contrôle propre où quelqu’un pourrait écrire.\nConséquence pratique : les arguments sont lus une seule fois, donc changer la route d’un médiateur en cours d’exécution exige de l’arrêter et de le relancer. Un fichier de configuration ne changerait rien — il est lui aussi lu au démarrage. Le tutoriel laisse volontairement ce point ouvert jusqu’à ce que le coût des médiateurs distribués ait été ressenti.",
"text": "3.5 Étapes 16–17 — Services et médiateur deviennent des processus\nLes trois capacités deviennent trois programmes, et le médiateur un quatrième type de programme :\n\n\n\n\n\n\n\n\n\nprogramme\njoue\nlit\nécrit\n\n\n\n\nSensorService.java\nConsoleIn\nle clavier\nconsoleIn/outbox\n\n\nProcessorService.java\nROT13\nrot13/inbox\nrot13/outbox\n\n\nActuatorService.java\nConsoleOut\nconsoleOut/inbox\nla console\n\n\nMediator.java &lt;from&gt; &lt;to&gt;\nla colle\n&lt;from&gt;\n&lt;to&gt;\n\n\n\nLe médiateur est générique : sa route n’est pas compilée en dur, elle arrive en deux arguments de démarrage. Mais une asymétrie mérite d’être gardée en tête : les trois capacités reçoivent leur travail sous forme de messages dans une boîte, tandis que le médiateur reçoit sa route comme configuration de démarrage, et il n’a ni nom ni boîte de contrôle propre où quelqu’un pourrait écrire.\nConséquence pratique : les arguments sont lus une seule fois, donc changer la route d’un médiateur en cours d’exécution exige de l’arrêter et de le relancer. Un fichier de configuration ne changerait rien — il est lui aussi lu au démarrage. Ce point reste volontairement ouvert jusqu’à ce que le coût des médiateurs distribués ait été ressenti.",
"crumbs": [
"<span class='chapter-number'>3</span>  <span class='chapter-title'>[Part II — Cross the process boundary]{.en}[Partie II — Franchir la frontière de processus]{.fr}[Teil II — Die Prozessgrenze überschreiten]{.de}</span>"
]
@@ -204,7 +194,7 @@
"href": "02-part-ii-processes.html#sec-step-18",
"title": "3  Partie II — Franchir la frontière de processus",
"section": "3.6 Étape 18 — Exécuter la version entièrement externe, en local",
"text": "3.6 Étape 18 — Exécuter la version entièrement externe, en local\nCinq terminaux, cinq processus, un seul système de fichiers local entre eux :\njava SensorService.java # terminal 1\njava Mediator.java consoleIn/outbox rot13/inbox # terminal 2\njava ProcessorService.java # terminal 3\njava Mediator.java rot13/outbox consoleOut/inbox # terminal 4\njava ActuatorService.java # terminal 5\nObservé : Hello World tapé dans le terminal 1 est apparu comme Uryyb Jbeyq dans le terminal 5. Les trois terminaux du milieu n’ont rien affiché de nouveau — chaque médiateur affiche une ligne « Mediating: … » au démarrage, et ProcessorService n’affiche rien du tout. Ensuite, chacun des quatre répertoires de boîtes contenait un fichier .msg : la même ligne, recopiée le long de la chaîne.\nComptons : cinq processus pour ce que l’étape 1 faisait en une instruction. La consigne du tutoriel à ce stade n’est pas d’optimiser : « We are not done making it painful. »\n\n\n\n\n\n\nFigure 3.1: Les cinq processus et les quatre répertoires de boîtes. Dans la version web, Lancer suit une ligne de texte du clavier à la console.",
"text": "3.6 Étape 18 — Exécuter la version entièrement externe, en local\nCinq terminaux, cinq processus, un seul système de fichiers local entre eux :\njava SensorService.java # terminal 1\njava Mediator.java consoleIn/outbox rot13/inbox # terminal 2\njava ProcessorService.java # terminal 3\njava Mediator.java rot13/outbox consoleOut/inbox # terminal 4\njava ActuatorService.java # terminal 5\nObservé : Hello World tapé dans le terminal 1 est apparu comme Uryyb Jbeyq dans le terminal 5. Les trois terminaux du milieu n’ont rien affiché de nouveau — chaque médiateur affiche une ligne « Mediating: … » au démarrage, et ProcessorService n’affiche rien du tout. Ensuite, chacun des quatre répertoires de boîtes contenait un fichier .msg : la même ligne, recopiée le long de la chaîne.\nComptons : cinq processus pour ce que l’étape 1 faisait en une instruction. Ce n’est pas le moment d’optimiser : ce n’est pas encore censé être confortable.\n\n\n\n\n\n\nFigure 3.1: Les cinq processus et les quatre répertoires de boîtes. Dans la version web, Lancer suit une ligne de texte du clavier à la console.",
"crumbs": [
"<span class='chapter-number'>3</span>  <span class='chapter-title'>[Part II — Cross the process boundary]{.en}[Partie II — Franchir la frontière de processus]{.fr}[Teil II — Die Prozessgrenze überschreiten]{.de}</span>"
]
@@ -218,5 +208,16 @@
"crumbs": [
"<span class='chapter-number'>3</span>  <span class='chapter-title'>[Part II — Cross the process boundary]{.en}[Partie II — Franchir la frontière de processus]{.fr}[Teil II — Die Prozessgrenze überschreiten]{.de}</span>"
]
},
{
"objectID": "glossary.html",
"href": "glossary.html",
"title": "Glossaire",
"section": "",
"text": "Chaque terme ci-dessous est défini là où il sert pour la première fois, et lié depuis chaque mention ultérieure. La flèche d’une entrée ramène à cet endroit.",
"crumbs": [
"Annexes",
"[Glossary]{.en}[Glossaire]{.fr}[Glossar]{.de}"
]
}
]
@@ -0,0 +1,34 @@
/* further — "to go further" notes: optional material, set apart in purple */
.further {
margin: 1.1rem 0;
padding: 0.5rem 0.9rem 0.6rem;
border: 1px solid color-mix(in srgb, var(--calc-furthercolor, #6B3FA0) 30%, transparent);
border-left: 3px solid var(--calc-furthercolor, #6B3FA0);
border-radius: 0.35rem;
background: color-mix(in srgb, var(--calc-furthercolor, #6B3FA0) 4%, transparent);
}
.further-head {
color: var(--calc-furthercolor, #6B3FA0);
font-weight: 600;
font-size: 0.92em;
margin-bottom: 0.35rem;
}
.further-body > p:first-child { margin-top: 0; }
.further-body > p:last-child { margin-bottom: 0; }
/* keep wide content inside the box, as .calc and .exo do */
.further mjx-container[display="true"],
.further .katex-display {
max-width: 100%;
overflow-x: auto;
overflow-y: hidden;
padding-bottom: 0.35em;
display: flex;
justify-content: center;
justify-content: safe center;
}
.further :is(pre, table) { max-width: 100%; overflow-x: auto; }
.further img, .further svg { max-width: 100%; }
@@ -32,9 +32,9 @@ mjx-container a {
padding: 0.5rem 0.75rem;
border: 1px solid var(--calc-notecolor, #B45309);
border-radius: 0.4rem;
background: var(--bs-body-bg, #fff);
background: var(--calc-surface, #fff);
color: var(--bs-body-color, #1a1a1a);
box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
box-shadow: 0 4px 14px var(--calc-shadow, rgba(0, 0, 0, 0.15));
font-size: 0.9em;
line-height: 1.4;
}
@@ -98,3 +98,18 @@
.calc-full { grid-column: 1 / 3; }
.calc-tag { grid-column: 1 / -1; }
}
/* --- interactive figures ------------------------------------------------
A figure that is dragged — a rotatable 3d view, a point moved with the
mouse — must not select its own labels while the pointer travels over
them: the browser would paint the axis names and captions as selected
text. The readouts and captions around the drawing stay selectable, so a
value can still be copied. The hooks are the ones every course's figure
scripts build into. */
[data-notes-fig] svg,
[data-notes-plot] svg,
[data-notes-fig] canvas,
[data-notes-plot] canvas {
-webkit-user-select: none;
user-select: none;
}
@@ -13,3 +13,58 @@
});
});
})();
// --- high contrast: a switch of its own, beside Quarto's light/dark one ----
// The class is already set before the first paint by the script calc-notes.lua
// puts in the head; this only builds the control and remembers a choice.
// Precedence: what the reader picked here, then `high-contrast: true` in the
// book, then the reader's system setting.
(function () {
var KEY = "notes-contrast";
var root = document.documentElement;
var LABELS = {
de: { on: "Hoher Kontrast aus", off: "Hoher Kontrast ein" },
fr: { on: "Désactiver le contraste élevé", off: "Activer le contraste élevé" },
en: { on: "Turn high contrast off", off: "Turn high contrast on" }
};
var lang = (root.lang || "en").slice(0, 2).toLowerCase();
var L = LABELS[lang] || LABELS.en;
function store(v) {
try { localStorage.setItem(KEY, v ? "more" : "normal"); } catch (e) {}
}
function paint() {
var on = root.classList.contains("hc");
document.querySelectorAll(".notes-contrast-toggle").forEach(function (b) {
b.setAttribute("aria-pressed", String(on));
b.setAttribute("title", on ? L.on : L.off);
b.setAttribute("aria-label", on ? L.on : L.off);
});
}
function build() {
var anchors = document.querySelectorAll(".quarto-color-scheme-toggle");
if (anchors.length === 0) return; // a page without Quarto's own tools
anchors.forEach(function (a) {
var b = document.createElement("button");
b.type = "button";
b.className = "quarto-navigation-tool px-1 notes-contrast-toggle";
// bootstrap-icons ships with these books; the glyph is the fallback
b.innerHTML = '<i class="bi bi-circle-half" aria-hidden="true"></i>';
b.addEventListener("click", function () {
var on = !root.classList.contains("hc");
root.classList.toggle("hc", on);
store(on);
paint();
});
a.parentNode.insertBefore(b, a.nextSibling);
});
paint();
}
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", build);
} else { build(); }
})();
@@ -0,0 +1,316 @@
/* high-contrast.css — the high-contrast pair, taken from GitHub's
"GitHub Light High Contrast" and "GitHub Dark High Contrast" VS Code
themes (the Primer `light_high_contrast` / `dark_high_contrast` scales).
It is switched by `hc` on <html>, which calc-notes.lua sets from
high-contrast: true
in the document metadata, and which the same in-header script sets for a
reader whose system asks for `prefers-contrast: more`. One class rather
than a class and a media query, so the palette below is written once.
It rides on top of the ordinary light/dark pair: `html.hc` restyles the
light theme, `html.hc body.quarto-dark` the night one, so the reader's own
light/dark toggle keeps working.
GitHub's two high-contrast themes separate things by outline rather than by
fill: text sits at full strength (fg.muted == fg.default), borders are
strong, and the tinted panels of the ordinary themes lose their tint. The
rules here do the same to the notes environments. */
/* ---------------------------------------------------------------- light -- */
html.hc {
/* Primer light_high_contrast */
--hc-canvas: #ffffff; /* canvas.default */
--hc-inset: #ffffff; /* canvas.inset — separation is by border */
--hc-fg: #0e1116; /* fg.default, and fg.muted, which equals it */
--hc-subtle: #66707b; /* fg.subtle — the only softened ink */
--hc-border: #20252c; /* border.default */
--hc-border-soft: #88929d; /* border.muted */
--hc-accent: #0349b4; /* accent.fg */
--hc-danger: #a0111f; /* danger.fg */
--hc-success: #055d20; /* success.fg */
--hc-attention: #4e2c00; /* attention.fg */
--hc-severe: #702c00; /* severe.fg */
--hc-done: #622cbc; /* done.fg */
/* the extension's own tokens */
--calc-ink: var(--hc-fg);
--calc-muted: var(--hc-fg);
--calc-line: var(--hc-border);
--calc-grid: var(--hc-border-soft);
--calc-accent-a: var(--hc-accent);
--calc-accent-b: var(--hc-severe);
--calc-accent-c: var(--hc-success);
--calc-danger: var(--hc-danger);
--calc-surface: var(--hc-canvas);
--calc-faint: var(--hc-border-soft);
--calc-shadow: rgba(14, 17, 22, 0.4);
--calc-domface: var(--hc-canvas);
--calc-domtop: #d8dee4;
--calc-notecolor: var(--hc-attention);
--calc-furthercolor: var(--hc-done);
/* the page itself */
--bs-body-bg: var(--hc-canvas);
--bs-body-color: var(--hc-fg);
--bs-emphasis-color: var(--hc-fg);
--bs-secondary-color: var(--hc-fg);
--bs-tertiary-color: var(--hc-subtle);
--bs-border-color: var(--hc-border);
--bs-link-color: var(--hc-accent);
--bs-link-hover-color: var(--hc-accent);
--bs-code-color: var(--hc-fg);
--bs-heading-color: var(--hc-fg);
}
/* ----------------------------------------------------------------- dark -- */
html.hc body.quarto-dark {
/* Primer dark_high_contrast, except for the canvas: the theme's own
#0a0c10 still reads as a very dark grey next to a black one, so the page
goes fully black and every other value keeps its relation to it. */
--hc-canvas: #000000; /* canvas.default is #0a0c10 upstream */
--hc-inset: #000000; /* canvas.inset */
--hc-subtle-bg: #272b33; /* canvas.subtle */
--hc-fg: #f0f3f6; /* fg.default == fg.muted */
--hc-subtle: #9ea7b3; /* fg.subtle */
--hc-border: #7a828e; /* border.default */
--hc-border-soft: #7a828e; /* border.muted — the same in this theme */
--hc-accent: #71b7ff; /* accent.fg */
--hc-danger: #ff9492; /* danger.fg */
--hc-success: #26cd4d; /* success.fg */
--hc-attention: #f0b72f; /* attention.fg */
--hc-severe: #ff803d; /* severe.fg */
--hc-done: #cb9eff; /* done.fg */
/* a stroke on near-black wants the text colour, not the border grey */
--calc-line: var(--hc-fg);
--calc-grid: var(--hc-border);
--calc-domface: var(--hc-subtle-bg);
--calc-domtop: #3d444d;
--calc-shadow: rgba(1, 4, 9, 0.8);
}
/* the tokens that only alias, so they follow whichever block is in force */
html.hc body.quarto-dark {
--calc-ink: var(--hc-fg);
--calc-muted: var(--hc-fg);
--calc-accent-a: var(--hc-accent);
--calc-accent-b: var(--hc-severe);
--calc-accent-c: var(--hc-success);
--calc-danger: var(--hc-danger);
--calc-surface: var(--hc-canvas);
--calc-faint: var(--hc-border);
--calc-notecolor: var(--hc-attention);
--calc-furthercolor: var(--hc-done);
--bs-body-bg: var(--hc-canvas);
--bs-body-color: var(--hc-fg);
--bs-emphasis-color: var(--hc-fg);
--bs-secondary-color: var(--hc-fg);
--bs-tertiary-color: var(--hc-subtle);
--bs-border-color: var(--hc-border);
--bs-link-color: var(--hc-accent);
--bs-link-hover-color: var(--hc-accent);
--bs-code-color: var(--hc-fg);
--bs-heading-color: var(--hc-fg);
}
/* --------------------------------------------------------- page chrome -- */
/* Quarto's own furniture is compiled from the bootswatch theme, so the
variables above do not reach all of it. */
html.hc body {
background-color: var(--hc-canvas);
color: var(--hc-fg);
}
html.hc :is(h1, h2, h3, h4, h5, h6, p, li, dt, dd, caption, figcaption, th, td) {
color: var(--hc-fg);
}
html.hc :is(.text-muted, .quarto-figure figcaption, figcaption.figure-caption,
.quarto-title-meta-heading, .quarto-title-meta-contents,
.callout-title-container, .footnotes) {
color: var(--hc-fg);
}
html.hc a:not(.nav-link):not(.sidebar-item-text) { color: var(--hc-accent); }
html.hc a:focus-visible,
html.hc button:focus-visible,
html.hc summary:focus-visible { outline: 2px solid var(--hc-accent); outline-offset: 2px; }
html.hc :is(#quarto-sidebar, #quarto-margin-sidebar, .sidebar, .sidebar-navigation,
#quarto-header, .navbar, .quarto-secondary-nav) {
background-color: var(--hc-canvas);
color: var(--hc-fg);
border-color: var(--hc-border);
}
html.hc :is(.sidebar-item-text, .sidebar .nav-link, nav[role="doc-toc"] a, .navbar .nav-link,
.quarto-secondary-nav .nav-link) {
color: var(--hc-fg);
opacity: 1;
}
html.hc .sidebar nav[role="doc-toc"] ul > li > a,
html.hc .sidebar-navigation .sidebar-item a,
html.hc .sidebar-navigation .sidebar-item .sidebar-item-text {
color: var(--hc-fg);
opacity: 1;
}
/* the active entry: Quarto writes its colour with !important, so this is the
one place the palette has to answer in kind */
html.hc .sidebar nav[role="doc-toc"] ul > li > a.active,
html.hc .sidebar nav[role="doc-toc"] ul > li > ul > li > a.active,
html.hc .sidebar nav[role="doc-toc"] ul > li > a:hover,
html.hc .sidebar-navigation .sidebar-item a.active,
html.hc .sidebar-navigation .sidebar-item a:hover {
color: var(--hc-accent) !important;
border-left-color: var(--hc-accent);
font-weight: 600;
}
html.hc nav[role="doc-toc"] { border-left: 1px solid var(--hc-border-soft); }
/* the breadcrumb of the collapsed header carries its own fill in both
bootswatch themes, and its ink is the weakest contrast on the page */
html.hc .breadcrumb {
background-color: var(--hc-canvas);
border: 1px solid var(--hc-border);
}
html.hc :is(.breadcrumb, .breadcrumb-item, .breadcrumb-item a, .quarto-btn-toggle) {
color: var(--hc-fg);
}
html.hc .breadcrumb-item a { color: var(--hc-accent); }
html.hc :is(hr, .quarto-title-block .quarto-title-banner, header#title-block-header) {
border-color: var(--hc-border);
}
html.hc hr { background-color: var(--hc-border); opacity: 1; }
html.hc blockquote {
border-left: 4px solid var(--hc-border);
color: var(--hc-fg);
}
html.hc :is(table, th, td) { border-color: var(--hc-border-soft); }
html.hc thead { border-bottom: 2px solid var(--hc-border); }
/* ------------------------------------------------------------- code ----- */
/* GitHub's high-contrast themes give a block an outline instead of a fill. */
html.hc :is(pre, div.sourceCode, pre.sourceCode) {
background-color: var(--hc-inset);
border: 1px solid var(--hc-border);
color: var(--hc-fg);
}
html.hc :not(pre) > code {
background-color: var(--hc-inset);
border: 1px solid var(--hc-border-soft);
border-radius: 3px;
color: var(--hc-fg);
padding: 0 0.2em;
}
html.hc code { color: var(--hc-fg); }
/* the syntax palette of the same two themes, mapped onto pandoc's classes */
html.hc code span:is(.co, .cv, .do, .an, .in) { color: var(--hc-subtle); font-style: italic; }
html.hc code span:is(.kw, .cf) { color: var(--hc-danger); }
html.hc code span:is(.st, .ch, .sc, .ss, .vs){ color: #032563; }
html.hc code span:is(.dv, .bn, .fl, .cn) { color: #023b95; }
html.hc code span:is(.fu, .ex) { color: #512598; }
html.hc code span:is(.va, .at) { color: var(--hc-severe); }
html.hc code span:is(.dt, .bu) { color: var(--hc-success); }
html.hc code span:is(.im, .pp) { color: var(--hc-severe); }
html.hc code span:is(.er, .wa, .al) { color: var(--hc-danger); font-weight: 600; }
html.hc code span:is(.op, .ot) { color: var(--hc-fg); }
html.hc body.quarto-dark code span:is(.st, .ch, .sc, .ss, .vs) { color: #addcff; }
html.hc body.quarto-dark code span:is(.dv, .bn, .fl, .cn) { color: #91cbff; }
html.hc body.quarto-dark code span:is(.fu, .ex) { color: #dbb7ff; }
html.hc body.quarto-dark code span:is(.co, .cv, .do, .an, .in) { color: #bdc4cc; }
/* ------------------------------------------- the notes environments ----- */
/* out goes the tint; the outline carries the box, at full accent strength */
html.hc :is(.exo, .further, .quiz, .gls-inline, .gls-float, .calc-note,
.exo-sol, .exo-hint, .quiz-opt) {
background: var(--hc-canvas);
}
html.hc .exo { border-color: var(--calc-notecolor); }
html.hc :is(.exo-sol, .exo-hint) { border-color: var(--calc-notecolor); }
html.hc .exo-head strong,
html.hc .exo-hint > summary { color: var(--calc-notecolor); }
html.hc .further { border-color: var(--calc-furthercolor); }
html.hc .gls-float { border-color: var(--calc-notecolor); box-shadow: 0 4px 14px var(--calc-shadow); }
html.hc :is(.gls-inline, .calc-note) { border-left-width: 4px; }
html.hc .gls-sym { text-decoration-color: var(--calc-notecolor); }
html.hc .quiz { --quiz-ok: var(--hc-success); --quiz-bad: var(--hc-danger); --quiz-ink: var(--hc-fg); }
html.hc :is(.quiz-opt.quiz-ok, .quiz-opt.quiz-bad) { background: var(--hc-canvas); }
html.hc .quiz-opt.quiz-ok { outline: 2px solid var(--hc-success); }
html.hc .quiz-opt.quiz-bad { outline: 2px solid var(--hc-danger); }
/* Quarto's own callouts, so a page does not mix outlined boxes with filled
ones; the callout keeps its colour, in its left bar and its title */
html.hc .callout {
background-color: var(--hc-canvas) !important;
border: 1px solid var(--hc-border);
}
html.hc .callout > .callout-header {
background-color: var(--hc-canvas) !important;
border-bottom: 1px solid var(--hc-border-soft);
}
html.hc :is(.callout-body, .callout-title-container, .callout-body-container p) {
color: var(--hc-fg);
}
html.hc .callout.callout-style-default > div.callout-header { font-weight: 600; }
/* Quarto's search box: its widget is not themed by the bootswatch pair, so it
stays white on a dark page unless it is told otherwise (see theme.css) */
html.hc :is(.aa-Form, .aa-InputWrapper, .aa-Panel, .aa-Item) {
background-color: var(--hc-canvas);
color: var(--hc-fg);
border-color: var(--hc-border);
}
html.hc :is(.aa-Autocomplete, .aa-DetachedFormContainer)
.aa-Form .aa-InputWrapper .aa-Input,
html.hc :is(.aa-Autocomplete, .aa-DetachedFormContainer)
.aa-Form .aa-InputWrapperSuffix .aa-ClearButton,
html.hc :is(.aa-Autocomplete, .aa-DetachedFormContainer)
.aa-Form .aa-InputWrapperPrefix :is(.aa-Label, .aa-LoadingIndicator) svg {
color: var(--hc-fg);
}
html.hc :is(.aa-Autocomplete, .aa-DetachedFormContainer)
.aa-Form .aa-InputWrapper .aa-Input::placeholder {
color: var(--hc-fg);
opacity: 0.75;
}
/* the results panel: Quarto colours the cards through an id, so this does too */
html.hc :is(.aa-DetachedOverlay, #quarto-search-results) li.aa-Item .search-item,
html.hc :is(.aa-DetachedOverlay, #quarto-search-results) li.aa-Item .search-item
:is(.search-result-title-container, .search-result-text-container,
.search-result-section, .search-result-text, .search-result-more) {
background-color: var(--hc-canvas);
color: var(--hc-fg);
}
html.hc :is(.aa-DetachedOverlay, #quarto-search-results) li.aa-Item[aria-selected="true"] .search-item,
html.hc :is(.aa-DetachedOverlay, #quarto-search-results) li.aa-Item[aria-selected="true"] .search-item
:is(.search-result-title-container, .search-result-text-container,
.search-result-section, .search-result-text, .search-result-more) {
background-color: var(--hc-accent);
color: var(--hc-canvas);
}
/* a hit is marked by weight and a rule, not by a block of colour */
html.hc :is(.aa-DetachedOverlay, #quarto-search-results) li.aa-Item .search-item
:is(mark.search-match, .search-match.mark) {
background-color: transparent;
color: inherit;
font-weight: 700;
text-decoration: underline;
}
/* the figure buttons of the animated schemes */
html.hc :is(.ns-btn, .nc-btn, .nd-replay) {
background: var(--hc-canvas);
color: var(--hc-fg);
border-color: var(--hc-border);
}
html.hc :is(.notes-spiral, .notes-cantor) :is(.ns-btn, .nc-btn)[aria-pressed="true"] {
background: var(--hc-canvas);
border-color: var(--hc-accent);
color: var(--hc-accent);
font-weight: 600;
}
/* the last tinted fills: a calc box and a note keep their outline instead */
html.hc :is(.calc-box, .calc-note, .calc-note[open]) { background: transparent; }
@@ -0,0 +1,50 @@
/* narrow.css — the book on a phone.
Nothing in the flow may be wider than the screen: a wide formula, table or
figure scrolls inside its own box instead of pushing the whole page
sideways (which leaves the text cut off at the left edge).
Loaded with calc-notes.css, so every page of every book gets it. */
/* --- display maths ------------------------------------------------------
The boxes of this extension (.calc, .exo, .further) already scroll their
own maths; this covers every other display formula on the page. */
:is(main, .quarto-title-block) :is(mjx-container[display="true"], .math.display) {
max-width: 100%;
overflow-x: auto;
overflow-y: hidden; /* Firefox computes phantom vertical overflow */
padding-bottom: 0.35em; /* keep descenders clear of a scrollbar */
/* a centred formula that overflows would hide its left side out of reach,
so centre it only while it fits */
justify-content: safe center;
}
/* --- everything else that can be wider than a phone ---------------------- */
main :is(pre, .sourceCode) { max-width: 100%; overflow-x: auto; }
main :is(img, svg) { max-width: 100%; height: auto; }
main table:not(.ltx-table) { display: block; max-width: 100%; overflow-x: auto; }
/* the animated figures of lesson-style chapters */
.notes-cantor, .notes-spiral, .notes-dominos { max-width: 100%; overflow-x: auto; }
/* the glossary popup: never wider than the screen */
.gls-float { max-width: min(92vw, 26rem); }
/* --- phone-sized screens ------------------------------------------------- */
@media (max-width: 575.98px) {
/* the equation number of a labelled calc block goes under the line, so the
formula keeps the full width */
.calc { grid-template-columns: max-content 1fr; }
/* figure captions and the fold summaries read better tight */
.exo, .further { padding-left: 0.6rem; padding-right: 0.6rem; }
/* A bare url in prose, or a long identifier in a code span, is one word to
the line breaker and paints past its block on a narrow screen — no
element is oversized, so only the text itself overflows. */
#quarto-document-content :is(a, code) { overflow-wrap: break-word; }
/* Quarto's own previous/next footer: the chapter titles are laid out in a
row that will not shrink, so a long title pushes the page sideways. */
.page-navigation { flex-wrap: wrap; row-gap: 0.75em; }
.nav-page, .nav-page .nav-page-text { min-width: 0; }
.nav-page .chapter-title { overflow-wrap: break-word; }
}
@@ -0,0 +1,129 @@
/* theme.css — one palette for every part of the notes extension, in light
mode, in night mode and in high contrast.
Night mode keys off Quarto's own `body.quarto-dark`, which the light/dark
toggle sets — never off `prefers-color-scheme`, so a book configured
light-only stays light for a reader whose system is dark.
A book opts in with, in _quarto.yml:
format:
html:
theme:
light: [cosmo]
dark: [darkly]
High contrast is a separate sheet, high-contrast.css, after GitHub's two
high-contrast VS Code themes. It keys off `hc` on <html>, which
calc-notes.lua sets from `high-contrast: true` in the metadata and for a
reader whose system asks for `prefers-contrast: more`.
Loaded with calc-notes.css, so every page of every book has these tokens. */
:root {
--calc-ink: #1a1a1a; /* figure text, strong strokes */
--calc-muted: #57606a; /* captions, readouts, button text */
--calc-line: #444444; /* axes and rules */
--calc-grid: #cccccc; /* lattice dots, faint grid */
--calc-accent-a: #1F6FB4; /* lineA of the tikz preamble */
--calc-accent-b: #D1541F; /* lineB */
--calc-accent-c: #2E8B57; /* lineC */
--calc-danger: #B91C1C; /* an error state, e.g. a failed code run */
--calc-surface: var(--bs-body-bg, #ffffff);
--calc-faint: #e7e9ec; /* hairlines between rows */
--calc-shadow: rgba(0, 0, 0, 0.15); /* floats above the page */
--calc-domface: #DCE7F2; /* the domino figure's front face */
--calc-domtop: #B8CFE4; /* its top face */
/* --calc-notecolor-src and --calc-furthercolor-src come from the document
metadata (calc-notes.lua / further.lua) and are the book's own colours;
--calc-notecolor and --calc-furthercolor are what everything draws with,
and equal the source here. The dark block lifts them. */
}
body.quarto-dark {
--calc-ink: #e6e9ed;
--calc-muted: #9aa4b2;
--calc-line: #b6bec7;
--calc-grid: #4b535d;
--calc-accent-a: #6fb0ea;
--calc-accent-b: #f0956a;
--calc-accent-c: #64c49a;
--calc-danger: #f08a8a;
--calc-faint: #3a4049;
--calc-shadow: rgba(0, 0, 0, 0.55);
--calc-domface: #2b3b4d;
--calc-domtop: #365070;
/* The book's own accent is kept, not replaced: its print value is too dim
on a dark ground, so it is lifted to a light tone at the same hue rather
than swapped for a generic amber. A book that wants a specific night
value sets `notecolor-dark:` / `furthercolor-dark:` in its metadata.
On a browser without relative colour syntax the lift is dropped and the
book's own colour is used unchanged. */
--calc-notecolor:
var(--calc-notecolor-dark,
oklch(from var(--calc-notecolor-src, #B45309) 0.78 c h));
--calc-furthercolor:
var(--calc-furthercolor-dark,
oklch(from var(--calc-furthercolor-src, #6B3FA0) 0.80 c h));
}
/* --- generated line art -------------------------------------------------
The tikz figures are black-and-colour line drawings on transparent white.
Inverting them keeps the drawing readable and, with the hue rotation,
keeps blue blue and orange orange. Photographs live under img/ and are
left alone; an svg that is a photograph, or that carries its own dark
palette, opts out with class="no-invert". */
body.quarto-dark main img[src$=".svg"]:not(.no-invert) {
filter: invert(1) hue-rotate(180deg);
}
/* --- higher contrast ---------------------------------------------------
The high-contrast pair lives in high-contrast.css, which is loaded with
this file and keys off `hc` on <html>. */
/* --- Quarto's search box -------------------------------------------------
The search widget keeps its own white surface whatever the bootswatch
theme says, so on a dark page it is a white slab with dark text. It is
given the page's own surface here rather than in each book. */
body.quarto-dark :is(.aa-Form, .aa-InputWrapper, .aa-Panel, .aa-Item,
.aa-DetachedContainer, .aa-DetachedFormContainer) {
background-color: var(--calc-surface, #222);
color: var(--calc-ink, #e6e9ed);
border-color: var(--calc-faint, #3a4049);
}
/* The ink inside the form is a separate problem from its surface: Quarto's
dark bundle sets the input, its placeholder, the clear button and the
magnifier to rgb(45,45,45) through a four-class selector, so a short one
loses the cascade and the typed text stays unreadable. The shape below
matches Quarto's own, which is the only way to win without !important. */
body.quarto-dark :is(.aa-Autocomplete, .aa-DetachedFormContainer)
.aa-Form .aa-InputWrapper .aa-Input,
body.quarto-dark :is(.aa-Autocomplete, .aa-DetachedFormContainer)
.aa-Form .aa-InputWrapperSuffix .aa-ClearButton,
body.quarto-dark :is(.aa-Autocomplete, .aa-DetachedFormContainer)
.aa-Form .aa-InputWrapperPrefix :is(.aa-Label, .aa-LoadingIndicator) svg {
color: var(--calc-ink, #e6e9ed);
}
body.quarto-dark :is(.aa-Autocomplete, .aa-DetachedFormContainer)
.aa-Form .aa-InputWrapper .aa-Input::placeholder {
color: var(--calc-muted, #9aa4b2);
}
/* --- the high-contrast switch -------------------------------------------
Built by calc-notes.js next to Quarto's light/dark toggle, and styled to
sit with it rather than stand out. */
.notes-contrast-toggle {
background: none;
border: 0;
color: inherit;
line-height: 1;
cursor: pointer;
opacity: 0.85;
}
.notes-contrast-toggle:hover { opacity: 1; }
.notes-contrast-toggle[aria-pressed="true"] {
opacity: 1;
color: var(--calc-accent-a, #1F6FB4);
}
.notes-contrast-toggle:focus-visible {
outline: 2px solid var(--calc-accent-a, #1F6FB4);
outline-offset: 2px;
}
@@ -0,0 +1,178 @@
/* quiz — tick-box self-checks: options, per-option explanations, score bar
*
* The card borrows .exo's frame so a quiz and an exercise look related.
* Green and red are reserved for the verdict: nothing else on the page uses
* them, so a colour here always means "this answer was judged".
*/
.quiz {
--quiz-ok: #1a7f5a;
--quiz-bad: #a3324a;
--quiz-ink: #5a6879;
margin: 1.4rem 0;
padding: 0.7rem 1rem 0.85rem;
border: 1px solid color-mix(in srgb, var(--calc-notecolor, #B45309) 35%, transparent);
border-left: 3px solid var(--calc-notecolor, #B45309);
border-radius: 0.35rem;
scroll-margin-top: 5rem;
}
/* keep wide content inside the card, as in .calc and .exo */
.quiz mjx-container[display="true"],
.quiz .katex-display {
max-width: 100%;
overflow-x: auto;
overflow-y: hidden;
padding-bottom: 0.35em;
display: flex;
justify-content: center;
justify-content: safe center;
}
.quiz .math.display { display: block; max-width: 100%; }
.quiz :is(pre, table) { max-width: 100%; overflow-x: auto; }
.quiz img, .quiz svg { max-width: 100%; }
.quiz-head { margin: 0 0 0.45rem; }
.quiz-head strong { color: var(--calc-notecolor, #B45309); }
.quiz-tip {
margin: 0 0 0.7rem;
font-size: 0.82rem;
color: var(--quiz-ink);
}
/* ---- questions ------------------------------------------------------ */
.quiz-q + .quiz-q {
margin-top: 1.1rem;
padding-top: 0.9rem;
border-top: 1px dashed color-mix(in srgb, var(--calc-notecolor, #B45309) 30%, transparent);
}
.quiz-q-head { margin: 0 0 0.35rem; font-size: 0.9em; }
/* ---- options -------------------------------------------------------- */
.quiz-opts {
list-style: none;
margin: 0.55rem 0 0;
padding: 0;
}
.quiz-opt {
margin: 0;
padding: 0.22rem 0.4rem;
border-radius: 0.25rem;
border-left: 2px solid transparent;
}
.quiz-opt + .quiz-opt { margin-top: 0.15rem; }
/* the whole row is the click target, so a long formula is still easy to tick */
.quiz-label {
display: flex;
align-items: baseline;
gap: 0.55rem;
cursor: pointer;
}
.quiz-box {
flex: 0 0 auto;
width: 1rem;
height: 1rem;
margin: 0;
/* baseline-align the box with the first line of the option text */
transform: translateY(0.15rem);
accent-color: var(--calc-notecolor, #B45309);
cursor: pointer;
}
.quiz-opt-text { min-width: 0; }
.quiz-opt-text > :first-child { margin-top: 0; }
.quiz-opt-text > :last-child { margin-bottom: 0; }
/* judged options */
.quiz-opt.quiz-ok {
background: color-mix(in srgb, var(--quiz-ok) 8%, transparent);
border-left-color: var(--quiz-ok);
}
.quiz-opt.quiz-bad {
background: color-mix(in srgb, var(--quiz-bad) 8%, transparent);
border-left-color: var(--quiz-bad);
}
/* ---- explanations --------------------------------------------------- */
.quiz-why {
margin: 0.35rem 0 0.15rem 1.55rem;
padding: 0.3rem 0 0.3rem 0.7rem;
border-left: 2px solid var(--quiz-bad);
font-size: 0.88rem;
}
.quiz-why > :first-child { margin-top: 0; }
.quiz-why > :last-child { margin-bottom: 0; }
.quiz-why-q {
margin-left: 0;
margin-top: 0.5rem;
}
/* ---- verdict and bar ------------------------------------------------ */
.quiz-verdict {
margin: 0.5rem 0 0;
font-size: 0.85rem;
font-weight: 600;
}
.quiz-verdict.quiz-ok { color: var(--quiz-ok); }
.quiz-verdict.quiz-bad { color: var(--quiz-bad); }
.quiz-bar {
display: flex;
align-items: center;
gap: 0.6rem;
flex-wrap: wrap;
margin-top: 1rem;
padding-top: 0.7rem;
border-top: 1px solid color-mix(in srgb, var(--calc-notecolor, #B45309) 25%, transparent);
}
.quiz-bar button {
font: inherit;
font-size: 0.84rem;
padding: 0.2rem 0.85rem;
cursor: pointer;
border: 1px solid color-mix(in srgb, var(--calc-notecolor, #B45309) 45%, transparent);
border-radius: 999px;
background: transparent;
color: var(--calc-notecolor, #B45309);
}
.quiz-bar button:hover {
background: color-mix(in srgb, var(--calc-notecolor, #B45309) 10%, transparent);
}
.quiz-bar button.quiz-reset {
border-color: color-mix(in srgb, var(--quiz-ink) 40%, transparent);
color: var(--quiz-ink);
}
.quiz-bar button.quiz-reset:hover {
background: color-mix(in srgb, var(--quiz-ink) 10%, transparent);
}
.quiz-score {
font-size: 0.84rem;
color: var(--quiz-ink);
}
.quiz-score b { color: var(--calc-notecolor, #B45309); font-weight: 600; }
/* ---- dark theme ----------------------------------------------------- */
body.quarto-dark .quiz {
--quiz-ok: #4cb08a;
--quiz-bad: #e2798f;
--quiz-ink: #8b98a8;
}
/* ---- print ----------------------------------------------------------
* Printing the HTML is a fallback (the pdf format is the real print path).
* A printed quiz is one to fill in with a pen: the bar goes, the boxes stay
* empty, and anything already revealed on screen is kept so a checked quiz
* prints as it looks.
*/
@media print {
.quiz-bar { display: none; }
.quiz-opt.quiz-ok, .quiz-opt.quiz-bad { background: none; }
}
@@ -0,0 +1,126 @@
// quiz — judge the tick boxes of one quiz, explain what went wrong
//
// Every label the reader sees is written into the markup by quiz.lua, so the
// wording follows the book's language and nothing is translated twice. A
// quiz carries:
// data-quiz-score "{n} of {m} questions correct" ({n}/{m} substituted)
// data-quiz-right verdict of a question answered correctly
// data-quiz-wrong verdict of a question answered wrongly
//
// A question is right only when every one of its options is in the right
// state: ticked when true, left empty when false. That is the "multiple
// true/false" rule of the exam, and it is why a half-ticked question counts
// as wrong.
(function () {
"use strict";
function options(quiz) {
return quiz.querySelectorAll(".quiz-opt");
}
function judge(quiz) {
var questions = quiz.querySelectorAll(".quiz-q");
var right = 0;
questions.forEach(function (q) {
var ok = true;
q.querySelectorAll(".quiz-opt").forEach(function (opt) {
var box = opt.querySelector(".quiz-box");
if (!box) return;
var want = opt.dataset.correct === "1";
var hit = box.checked === want;
opt.classList.toggle("quiz-ok", hit);
opt.classList.toggle("quiz-bad", !hit);
// the explanation of an option is for the reader who got it wrong
var why = opt.querySelector(".quiz-why");
if (why) why.hidden = hit;
if (!hit) ok = false;
});
var verdict = q.querySelector(".quiz-verdict");
if (verdict) {
verdict.hidden = false;
verdict.textContent = ok
? (quiz.dataset.quizRight || "Correct")
: (quiz.dataset.quizWrong || "Not quite");
verdict.classList.toggle("quiz-ok", ok);
verdict.classList.toggle("quiz-bad", !ok);
}
// a question-level explanation backs up a wrong answer as a whole
var qwhy = q.querySelector(".quiz-why-q");
if (qwhy) qwhy.hidden = ok;
if (ok) right++;
});
var score = quiz.querySelector(".quiz-score");
if (score) {
var template = quiz.dataset.quizScore || "{n}/{m}";
score.innerHTML = "";
// built as nodes, not markup: the template comes from metadata
var parts = template.split(/\{n\}|\{m\}/);
var values = [];
(template.match(/\{n\}|\{m\}/g) || []).forEach(function (token) {
values.push(token === "{n}" ? right : questions.length);
});
parts.forEach(function (text, i) {
score.appendChild(document.createTextNode(text));
if (i < values.length) {
var b = document.createElement("b");
b.textContent = String(values[i]);
score.appendChild(b);
}
});
}
}
function reset(quiz) {
options(quiz).forEach(function (opt) {
var box = opt.querySelector(".quiz-box");
if (box) box.checked = false;
opt.classList.remove("quiz-ok", "quiz-bad");
var why = opt.querySelector(".quiz-why");
if (why) why.hidden = true;
});
quiz.querySelectorAll(".quiz-verdict").forEach(function (v) {
v.hidden = true;
v.textContent = "";
v.classList.remove("quiz-ok", "quiz-bad");
});
quiz.querySelectorAll(".quiz-why-q").forEach(function (w) { w.hidden = true; });
var score = quiz.querySelector(".quiz-score");
if (score) score.textContent = "";
}
document.addEventListener("click", function (event) {
var target = event.target;
if (!target.closest) return;
var check = target.closest(".quiz .quiz-check");
if (check) {
judge(check.closest(".quiz"));
return;
}
var again = target.closest(".quiz .quiz-reset");
if (again) {
reset(again.closest(".quiz"));
}
});
// re-ticking a box after checking clears that row's verdict, so a stale
// green or red never sits next to a box the reader has just changed
document.addEventListener("change", function (event) {
var box = event.target;
if (!box.closest || !box.classList || !box.classList.contains("quiz-box")) return;
var opt = box.closest(".quiz-opt");
if (!opt) return;
opt.classList.remove("quiz-ok", "quiz-bad");
var why = opt.querySelector(".quiz-why");
if (why) why.hidden = true;
});
})();
+58 -14
View File
@@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>Glossary – From Calling to Eventing</title>
<title>Glossary – Process Control</title>
<style>
/* Default styles provided by pandoc.
** See https://pandoc.org/MANUAL.html#variables-for-html for config info.
@@ -51,9 +51,13 @@ ul.task-list li input[type="checkbox"] {
<link href="site_libs/quarto-contrib/calc-exo-2.0.0/exo.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-quiz-1.0.0/quiz.js"></script>
<link href="site_libs/quarto-contrib/calc-quiz-1.0.0/quiz.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-further-1.0.0/further.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-latex-tables-1.0.0/latex-tables.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-notes-1.0.0/calc-notes.js"></script>
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/theme.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/high-contrast.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/calc-notes.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/narrow.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-glossary-2.0.0/glossary.js"></script>
<link href="site_libs/quarto-contrib/calc-glossary-2.0.0/glossary.css" rel="stylesheet">
<script id="quarto-search-options" type="application/json">{
@@ -96,7 +100,7 @@ ul.task-list li input[type="checkbox"] {
nothing is attached to the links themselves: one capture-phase listener on
the document reads the link's final address at click time.
If a language has not been built (./render-all.sh), its pages do not exist:
If a language has not been built, its pages do not exist:
the target is checked first and a short note is shown instead of a
"Not Found" page.
@@ -112,12 +116,9 @@ ul.task-list li input[type="checkbox"] {
var ROOT_LANG = 'en'; // the language at the top of _book/
var COOKIE = 'notes-lang';
var NOTE = {
de: 'Diese Sprache wurde noch nicht erstellt. Einmal ./render-all.sh ausführen – '
+ 'danach funktioniert der Wechsel auch in der Vorschau.',
fr: 'Cette langue n’a pas encore été générée. Lancez une fois ./render-all.sh : '
+ 'ensuite le changement fonctionne aussi dans l’aperçu.',
en: 'This language hasn’t been built yet. Run ./render-all.sh once, '
+ 'then switching works in the preview too.'
de: 'Diese Sprache ist hier noch nicht verfügbar.',
fr: 'Cette langue n’est pas encore disponible ici.',
en: 'This language is not available here yet.'
};
var here = (document.documentElement.lang || ROOT_LANG).slice(0, 2);
@@ -131,9 +132,20 @@ ul.task-list li input[type="checkbox"] {
var m = document.cookie.match(/(?:^|;\s*)notes-lang=(de|fr|en)(?:;|$)/);
return m ? m[1] : null;
}
// path '/' on purpose: every book of these notes is served from one host,
// each under its own folder, so a language picked in any of them is the
// language all of them open in. A book hosted on its own would be no worse
// off -- the cookie simply has nothing else to reach.
var COOKIE_PATH = '/';
function remember(code) {
document.cookie = COOKIE + '=' + code + '; path=' + root + '; max-age=31536000; SameSite=Lax'
document.cookie = COOKIE + '=' + code + '; path=' + COOKIE_PATH
+ '; max-age=31536000; SameSite=Lax'
+ (location.protocol === 'https:' ? '; Secure' : '');
// a copy written under the book's own path by an earlier version would be
// the more specific one and would shadow the shared cookie for good
if (root !== COOKIE_PATH) {
document.cookie = COOKIE + '=; path=' + root + '; max-age=0';
}
}
// a returning reader lands in the language picked last time
@@ -155,7 +167,11 @@ ul.task-list li input[type="checkbox"] {
box.style.cssText = 'position:fixed;left:50%;bottom:1.25rem;transform:translateX(-50%);'
+ 'max-width:min(34rem,calc(100vw - 2rem));padding:.6rem .9rem;border-radius:6px;'
+ 'background:#1f2328;color:#fff;font-size:.85rem;line-height:1.4;z-index:2000;'
+ 'box-shadow:0 4px 16px rgba(0,0,0,.25)';
// a status message, so it keeps its own dark surface in either mode; the
// hairline is the page's rule colour, invisible on a light page and an
// edge against a dark one, where the shadow alone no longer separates it
+ 'border:1px solid var(--calc-line,#444);'
+ 'box-shadow:0 4px 16px var(--calc-shadow,rgba(0,0,0,.25))';
document.body.appendChild(box);
setTimeout(function () { box.remove(); }, 7000);
}
@@ -196,7 +212,35 @@ ul.task-list li input[type="checkbox"] {
}, true);
})();
</script>
<style>:root { --calc-notecolor: #B45309; }</style>
<style>:root {
--calc-furthercolor-src: #6B3FA0;
--calc-furthercolor: var(--calc-furthercolor-src);
}</style>
<style>:root {
--calc-notecolor-src: #B45309;
--calc-notecolor: var(--calc-notecolor-src);
}</style>
<script>(function (e) {
var KEY = 'notes-contrast', forced = false;
var picked = null;
try { picked = localStorage.getItem(KEY); } catch (err) {}
var q = null;
try { q = window.matchMedia && window.matchMedia('(prefers-contrast: more)'); } catch (err) {}
if (picked === 'more' || (picked !== 'normal' && (forced || (q && q.matches)))) {
e.classList.add('hc');
}
if (q) {
var f = function () {
var p = null;
try { p = localStorage.getItem(KEY); } catch (err) {}
if (p === null) e.classList.toggle('hc', forced || q.matches);
};
if (q.addEventListener) q.addEventListener('change', f);
else if (q.addListener) q.addListener(f);
}
})(document.documentElement);</script>
</head>
@@ -225,7 +269,7 @@ ul.task-list li input[type="checkbox"] {
<nav id="quarto-sidebar" class="sidebar collapse collapse-horizontal quarto-sidebar-collapse-item sidebar-navigation docked overflow-auto">
<div class="pt-lg-2 mt-2 text-left sidebar-header">
<div class="sidebar-title mb-0 py-0">
<a href="./">From Calling to Eventing</a>
<a href="./">Process Control</a>
<div class="sidebar-tools-main tools-wide">
<div class="dropdown">
<a href="" title="" id="quarto-navigation-tool-dropdown-0" class="quarto-navigation-tool dropdown-toggle px-1" data-bs-toggle="dropdown" aria-expanded="false" role="link" aria-label=""><i class="bi bi-translate"></i></a>
@@ -247,7 +291,7 @@ ul.task-list li input[type="checkbox"] {
</li>
</ul>
</div>
<a href="./From-Calling-to-Eventing.pdf" title="Download PDF" class="quarto-navigation-tool px-1" aria-label="Download PDF"><i class="bi bi-file-pdf"></i></a>
<a href="./Process-Control.pdf" title="Download PDF" class="quarto-navigation-tool px-1" aria-label="Download PDF"><i class="bi bi-file-pdf"></i></a>
<a href="" class="quarto-reader-toggle quarto-navigation-tool px-1" onclick="window.quartoToggleReader(); return false;" title="Toggle reader mode">
<div class="quarto-reader-toggle-btn">
<i class="bi"></i>
@@ -272,7 +316,7 @@ ul.task-list li input[type="checkbox"] {
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./00-orientation.html" class="sidebar-item-text sidebar-link">
<span class="menu-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Step 0 — What the tutorial is about</span></span></a>
<span class="menu-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Step 0 — What this is about</span></span></a>
</div>
</li>
<li class="sidebar-item">
+88 -67
View File
@@ -7,9 +7,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<meta name="author" content="Romain De Groote">
<meta name="dcterms.date" content="2026-09-24">
<meta name="dcterms.date" content="2026-09-25">
<title>From Calling to Eventing</title>
<title>Process Control</title>
<style>
/* Default styles provided by pandoc.
** See https://pandoc.org/MANUAL.html#variables-for-html for config info.
@@ -28,41 +28,6 @@ ul.task-list li input[type="checkbox"] {
margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */
vertical-align: middle;
}
/* CSS for syntax highlighting */
html { -webkit-text-size-adjust: 100%; }
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
}
pre.numberSource { margin-left: 3em; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
</style>
@@ -86,9 +51,15 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<link href="site_libs/bootstrap/bootstrap-cfe7114cbc4adb2af5ff3a891545d7fa.min.css" rel="stylesheet" append-hash="true" id="quarto-bootstrap" data-mode="light">
<script src="site_libs/quarto-contrib/calc-exo-2.0.0/exo.js"></script>
<link href="site_libs/quarto-contrib/calc-exo-2.0.0/exo.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-quiz-1.0.0/quiz.js"></script>
<link href="site_libs/quarto-contrib/calc-quiz-1.0.0/quiz.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-further-1.0.0/further.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-latex-tables-1.0.0/latex-tables.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-notes-1.0.0/calc-notes.js"></script>
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/theme.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/high-contrast.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/calc-notes.css" rel="stylesheet">
<link href="site_libs/quarto-contrib/calc-notes-1.0.0/narrow.css" rel="stylesheet">
<script src="site_libs/quarto-contrib/calc-glossary-2.0.0/glossary.js"></script>
<link href="site_libs/quarto-contrib/calc-glossary-2.0.0/glossary.css" rel="stylesheet">
<script id="quarto-search-options" type="application/json">{
@@ -131,7 +102,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
nothing is attached to the links themselves: one capture-phase listener on
the document reads the link's final address at click time.
If a language has not been built (./render-all.sh), its pages do not exist:
If a language has not been built, its pages do not exist:
the target is checked first and a short note is shown instead of a
"Not Found" page.
@@ -147,12 +118,9 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
var ROOT_LANG = 'en'; // the language at the top of _book/
var COOKIE = 'notes-lang';
var NOTE = {
de: 'Diese Sprache wurde noch nicht erstellt. Einmal ./render-all.sh ausführen – '
+ 'danach funktioniert der Wechsel auch in der Vorschau.',
fr: 'Cette langue n’a pas encore été générée. Lancez une fois ./render-all.sh : '
+ 'ensuite le changement fonctionne aussi dans l’aperçu.',
en: 'This language hasn’t been built yet. Run ./render-all.sh once, '
+ 'then switching works in the preview too.'
de: 'Diese Sprache ist hier noch nicht verfügbar.',
fr: 'Cette langue n’est pas encore disponible ici.',
en: 'This language is not available here yet.'
};
var here = (document.documentElement.lang || ROOT_LANG).slice(0, 2);
@@ -166,9 +134,20 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
var m = document.cookie.match(/(?:^|;\s*)notes-lang=(de|fr|en)(?:;|$)/);
return m ? m[1] : null;
}
// path '/' on purpose: every book of these notes is served from one host,
// each under its own folder, so a language picked in any of them is the
// language all of them open in. A book hosted on its own would be no worse
// off -- the cookie simply has nothing else to reach.
var COOKIE_PATH = '/';
function remember(code) {
document.cookie = COOKIE + '=' + code + '; path=' + root + '; max-age=31536000; SameSite=Lax'
document.cookie = COOKIE + '=' + code + '; path=' + COOKIE_PATH
+ '; max-age=31536000; SameSite=Lax'
+ (location.protocol === 'https:' ? '; Secure' : '');
// a copy written under the book's own path by an earlier version would be
// the more specific one and would shadow the shared cookie for good
if (root !== COOKIE_PATH) {
document.cookie = COOKIE + '=; path=' + root + '; max-age=0';
}
}
// a returning reader lands in the language picked last time
@@ -190,7 +169,11 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
box.style.cssText = 'position:fixed;left:50%;bottom:1.25rem;transform:translateX(-50%);'
+ 'max-width:min(34rem,calc(100vw - 2rem));padding:.6rem .9rem;border-radius:6px;'
+ 'background:#1f2328;color:#fff;font-size:.85rem;line-height:1.4;z-index:2000;'
+ 'box-shadow:0 4px 16px rgba(0,0,0,.25)';
// a status message, so it keeps its own dark surface in either mode; the
// hairline is the page's rule colour, invisible on a light page and an
// edge against a dark one, where the shadow alone no longer separates it
+ 'border:1px solid var(--calc-line,#444);'
+ 'box-shadow:0 4px 16px var(--calc-shadow,rgba(0,0,0,.25))';
document.body.appendChild(box);
setTimeout(function () { box.remove(); }, 7000);
}
@@ -231,7 +214,35 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
}, true);
})();
</script>
<style>:root { --calc-notecolor: #B45309; }</style>
<style>:root {
--calc-furthercolor-src: #6B3FA0;
--calc-furthercolor: var(--calc-furthercolor-src);
}</style>
<style>:root {
--calc-notecolor-src: #B45309;
--calc-notecolor: var(--calc-notecolor-src);
}</style>
<script>(function (e) {
var KEY = 'notes-contrast', forced = false;
var picked = null;
try { picked = localStorage.getItem(KEY); } catch (err) {}
var q = null;
try { q = window.matchMedia && window.matchMedia('(prefers-contrast: more)'); } catch (err) {}
if (picked === 'more' || (picked !== 'normal' && (forced || (q && q.matches)))) {
e.classList.add('hc');
}
if (q) {
var f = function () {
var p = null;
try { p = localStorage.getItem(KEY); } catch (err) {}
if (p === null) e.classList.toggle('hc', forced || q.matches);
};
if (q.addEventListener) q.addEventListener('change', f);
else if (q.addListener) q.addListener(f);
}
})(document.documentElement);</script>
</head>
@@ -260,7 +271,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<nav id="quarto-sidebar" class="sidebar collapse collapse-horizontal quarto-sidebar-collapse-item sidebar-navigation docked overflow-auto">
<div class="pt-lg-2 mt-2 text-left sidebar-header">
<div class="sidebar-title mb-0 py-0">
<a href="./">From Calling to Eventing</a>
<a href="./">Process Control</a>
<div class="sidebar-tools-main tools-wide">
<div class="dropdown">
<a href="" title="" id="quarto-navigation-tool-dropdown-0" class="quarto-navigation-tool dropdown-toggle px-1" data-bs-toggle="dropdown" aria-expanded="false" role="link" aria-label=""><i class="bi bi-translate"></i></a>
@@ -282,7 +293,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
</li>
</ul>
</div>
<a href="./From-Calling-to-Eventing.pdf" title="Download PDF" class="quarto-navigation-tool px-1" aria-label="Download PDF"><i class="bi bi-file-pdf"></i></a>
<a href="./Process-Control.pdf" title="Download PDF" class="quarto-navigation-tool px-1" aria-label="Download PDF"><i class="bi bi-file-pdf"></i></a>
<a href="" class="quarto-reader-toggle quarto-navigation-tool px-1" onclick="window.quartoToggleReader(); return false;" title="Toggle reader mode">
<div class="quarto-reader-toggle-btn">
<i class="bi"></i>
@@ -307,7 +318,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./00-orientation.html" class="sidebar-item-text sidebar-link">
<span class="menu-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Step 0 — What the tutorial is about</span></span></a>
<span class="menu-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Step 0 — What this is about</span></span></a>
</div>
</li>
<li class="sidebar-item">
@@ -321,6 +332,23 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<a href="./02-part-ii-processes.html" class="sidebar-item-text sidebar-link">
<span class="menu-text"><span class="chapter-number">3</span>&nbsp; <span class="chapter-title">Part II — Cross the process boundary</span></span></a>
</div>
</li>
<li class="sidebar-item sidebar-item-section">
<div class="sidebar-item-container">
<a class="sidebar-item-text sidebar-link text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" role="navigation" aria-expanded="false">
<span class="menu-text">Appendices</span></a>
<a class="sidebar-item-toggle text-start collapsed" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" role="navigation" aria-expanded="false" aria-label="Toggle section">
<i class="bi bi-chevron-right ms-2"></i>
</a>
</div>
<ul id="quarto-sidebar-section-1" class="collapse list-unstyled sidebar-section depth1 ">
<li class="sidebar-item">
<div class="sidebar-item-container">
<a href="./glossary.html" class="sidebar-item-text sidebar-link">
<span class="menu-text">Glossary</span></a>
</div>
</li>
</ul>
</li>
</ul>
</div>
@@ -335,7 +363,6 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<li><a href="#sec-about" id="toc-sec-about" class="nav-link active" data-scroll-target="#sec-about">About these notes</a>
<ul class="collapse">
<li><a href="#sec-diagrams" id="toc-sec-diagrams" class="nav-link" data-scroll-target="#sec-diagrams">How to read the diagrams</a></li>
<li><a href="#sec-build" id="toc-sec-build" class="nav-link" data-scroll-target="#sec-build">Building this book</a></li>
</ul></li>
</ul>
</nav>
@@ -345,7 +372,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<header id="title-block-header" class="quarto-title-block default">
<div class="quarto-title">
<h1 class="title">From Calling to Eventing</h1>
<h1 class="title">Process Control</h1>
</div>
@@ -362,7 +389,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<div>
<div class="quarto-title-meta-heading">Published</div>
<div class="quarto-title-meta-contents">
<p class="date">24 September 2026</p>
<p class="date">25 September 2026</p>
</div>
</div>
@@ -372,7 +399,7 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
<div>
<div class="abstract">
<div class="block-title">Abstract</div>
Step-by-step summaries of the SIN.04028 tutorial “From Calling to Eventing”, from direct method calls to an Event-Driven Architecture over MQTT. Process Control, given by Reto Konig, University of Fribourg, autumn semester 2026.
One small program, rebuilt step by step from direct method calls to an Event-Driven Architecture over MQTT: what moves at each step, and who ends up knowing whom.
</div>
</div>
@@ -395,34 +422,28 @@ MULTILINGUAL (see _extensions/notes/i18n.lua):
picture, just still.
- fixed section ids (#sec-...) so anchors are identical in all three books.
English is the verified source: the tutorial being summarised is written in
English. French and German are translations of it.
English is the verified source: the material these notes are built from is
written in English. French and German are translations of it.
Code identifiers, mailbox and topic names, file names, commands and protocol
terms are never translated (consoleIn.outbox, rot13/inbox, WatchService,
Mediator.java, .msg, put/take, Intent/Status/Event).
-->
<p>These notes summarise the tutorial <strong>“SIN.04028 — From Calling to Eventing”</strong>, worked through step by step. The tutorial itself lives next to this book, in <code>SIN.04028-From-Calling-to-Eventing/README.md</code>, and belongs to the <em>Process Control</em> course given by Reto Konig at the University of Fribourg (autumn semester 2026).</p>
<p>These notes follow one small program through a long series of rebuilds, from direct method calls to an event-driven architecture over MQTT. Every rebuild leaves the program doing exactly what it did before, and changes who knows about whom.</p>
<p>The program under construction never changes: you type a line, it comes back rotated by 13 letters.</p>
<pre class="text"><code>keyboard → ROT13 → console</code></pre>
<p>What changes is everything around it. The tutorial rebuilds the same system again and again while asking three questions, in this order:</p>
<p>What changes is everything around it. The same system is rebuilt again and again, and each rebuild asks three questions, in this order:</p>
<blockquote class="blockquote">
<p><strong>Who knows whom?</strong></p>
<p><strong>Who owns what?</strong></p>
<p><strong>Who decides how the system is wired together?</strong></p>
</blockquote>
<p>One summary is added here each time a step is finished, so the book grows at the pace of the work. Each summary says what the step did, what was observed when it ran, and what moved architecturally — usually a piece of knowledge that changed hands.</p>
<p><em>Based on material by Reto Konig, University of Fribourg.</em></p>
<section id="sec-diagrams" class="level2">
<h2 class="anchored" data-anchor-id="sec-diagrams">How to read the diagrams</h2>
<p>Every diagram exists once as a drawing and three times as a language. In the web version, a diagram that carries a message flow has a small play bar under it: <strong>Play</strong> walks one message through the whole chain, <strong>One hop</strong> advances a single step, and <strong>Reset</strong> puts it back. Boxes light up as the message reaches them, so you can see which component is waiting and which one is working.</p>
<p>In the PDF, and in a browser with JavaScript switched off, the same picture is there — just still. Nothing in the notes depends on the animation.</p>
</section>
<section id="sec-build" class="level2">
<h2 class="anchored" data-anchor-id="sec-build">Building this book</h2>
<p>The three books come from one source:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./render-all.sh</span> <span class="co"># figures, then html + pdf for en, fr, de</span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a><span class="ex">./render-all.sh</span> <span class="at">--serve</span> <span class="co"># …and serve _book/ on http://localhost:8000</span></span></code></pre></div><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></div>
<p><code>_book/</code> holds the English book, <code>_book/fr/</code> the French one and <code>_book/de/</code> the German one; the language menu in the sidebar switches between them and remembers the choice. A single <code>quarto render</code> builds English only and empties <code>_book/</code>, which removes the other two — so use the script.</p>
</section>
@@ -1052,8 +1073,8 @@ Mediator.java, .msg, put/take, Intent/Status/Event).
<div class="nav-page nav-page-previous">
</div>
<div class="nav-page nav-page-next">
<a href="./00-orientation.html" class="pagination-link" aria-label="[Step 0 — What the tutorial is about]{.en}[Étape 0 — De quoi parle le tutoriel]{.fr}[Schritt 0 — Worum es im Tutorial geht]{.de}">
<span class="nav-page-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Step 0 — What the tutorial is about</span></span> <i class="bi bi-arrow-right-short"></i>
<a href="./00-orientation.html" class="pagination-link" aria-label="[Step 0 — What this is about]{.en}[Étape 0 — De quoi il s'agit]{.fr}[Schritt 0 — Worum es geht]{.de}">
<span class="nav-page-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">Step 0 — What this is about</span></span> <i class="bi bi-arrow-right-short"></i>
</a>
</div>
</nav>
+20 -30
View File
@@ -2,9 +2,9 @@
{
"objectID": "index.html",
"href": "index.html",
"title": "From Calling to Eventing",
"title": "Process Control",
"section": "",
"text": "About these notes\nThese notes summarise the tutorial “SIN.04028 — From Calling to Eventing”, worked through step by step. The tutorial itself lives next to this book, in SIN.04028-From-Calling-to-Eventing/README.md, and belongs to the Process Control course given by Reto Konig at the University of Fribourg (autumn semester 2026).\nThe program under construction never changes: you type a line, it comes back rotated by 13 letters.\nWhat changes is everything around it. The tutorial rebuilds the same system again and again while asking three questions, in this order:\nOne summary is added here each time a step is finished, so the book grows at the pace of the work. Each summary says what the step did, what was observed when it ran, and what moved architecturally — usually a piece of knowledge that changed hands.",
"text": "About these notes\nThese notes follow one small program through a long series of rebuilds, from direct method calls to an event-driven architecture over MQTT. Every rebuild leaves the program doing exactly what it did before, and changes who knows about whom.\nThe program under construction never changes: you type a line, it comes back rotated by 13 letters.\nWhat changes is everything around it. The same system is rebuilt again and again, and each rebuild asks three questions, in this order:\nOne summary is added here each time a step is finished, so the book grows at the pace of the work. Each summary says what the step did, what was observed when it ran, and what moved architecturally — usually a piece of knowledge that changed hands.\nBased on material by Reto Konig, University of Fribourg.",
"crumbs": [
"[About these notes]{.en}[À propos de ces notes]{.fr}[Über diese Notizen]{.de}"
]
@@ -12,41 +12,31 @@
{
"objectID": "index.html#sec-diagrams",
"href": "index.html#sec-diagrams",
"title": "From Calling to Eventing",
"title": "Process Control",
"section": "How to read the diagrams",
"text": "How to read the diagrams\nEvery diagram exists once as a drawing and three times as a language. In the web version, a diagram that carries a message flow has a small play bar under it: Play walks one message through the whole chain, One hop advances a single step, and Reset puts it back. Boxes light up as the message reaches them, so you can see which component is waiting and which one is working.\nIn the PDF, and in a browser with JavaScript switched off, the same picture is there — just still. Nothing in the notes depends on the animation.",
"crumbs": [
"[About these notes]{.en}[À propos de ces notes]{.fr}[Über diese Notizen]{.de}"
]
},
{
"objectID": "index.html#sec-build",
"href": "index.html#sec-build",
"title": "From Calling to Eventing",
"section": "Building this book",
"text": "Building this book\nThe three books come from one source:\n./render-all.sh # figures, then html + pdf for en, fr, de\n./render-all.sh --serve # …and serve _book/ on http://localhost:8000\n_book/ holds the English book, _book/fr/ the French one and _book/de/ the German one; the language menu in the sidebar switches between them and remembers the choice. A single quarto render builds English only and empties _book/, which removes the other two — so use the script.",
"crumbs": [
"[About these notes]{.en}[À propos de ces notes]{.fr}[Über diese Notizen]{.de}"
]
},
{
"objectID": "00-orientation.html",
"href": "00-orientation.html",
"title": "1  Step 0 — What the tutorial is about",
"title": "1  Step 0 — What this is about",
"section": "",
"text": "1.1 The three questions\nStep 0 contains no code. It states the subject: not ROT13, but the architecture around it. The functionality stays almost unchanged for 81 steps, which is what makes the changes around it visible.\nTwo rules are set here and hold for the whole tutorial:\nThat is why the tutorial does not start with MQTT, and not with dynamic subscriptions either. It first builds a system with deliberately awkward mediators, puts it into operation, and only then asks whether they have earned their place.\nThe second rule is about vocabulary: Intent, Status/State and Event are named only after they have been used. They appear in the tutorial around step 42, not before.\nThe planned route, from step 0:\nThe wording of the three questions matters, and it is easy to replace it with something weaker:\n“Knowing” is not “communicating”: two components can exchange messages all day without either one naming the other. “Deciding the wiring” is not “connecting”: the part that forwards messages need not be the part that chose the route. Both distinctions become concrete later — the first already in step 1, the second in part III.",
"text": "1.1 The three questions\nStep 0 contains no code. It states the subject: not ROT13, but the architecture around it. The functionality stays almost unchanged for 81 steps, which is what makes the changes around it visible.\nTwo rules are set here and hold all the way through:\nThat is why the build-up does not start with MQTT, and not with dynamic subscriptions either. A system with deliberately awkward mediators is built first, put into operation, and only then asked whether those mediators have earned their place.\nThe second rule is about vocabulary: Intent, Status/State and Event are named only after they have been used. They appear around step 42, not before.\nThe planned route, from step 0:\nThe wording of the three questions matters, and it is easy to replace it with something weaker:\n“Knowing” is not “communicating”: two components can exchange messages all day without either one naming the other. “Deciding the wiring” is not “connecting”: the part that forwards messages need not be the part that chose the route. Both distinctions become concrete later — the first already in step 1, the second in part III.",
"crumbs": [
"<span class='chapter-number'>1</span>  <span class='chapter-title'>[Step 0 — What the tutorial is about]{.en}[Étape 0 — De quoi parle le tutoriel]{.fr}[Schritt 0 — Worum es im Tutorial geht]{.de}</span>"
"<span class='chapter-number'>1</span>  <span class='chapter-title'>[Step 0 — What this is about]{.en}[Étape 0 — De quoi il s'agit]{.fr}[Schritt 0 — Worum es geht]{.de}</span>"
]
},
{
"objectID": "00-orientation.html#sec-three-questions",
"href": "00-orientation.html#sec-three-questions",
"title": "1  Step 0 — What the tutorial is about",
"title": "1  Step 0 — What this is about",
"section": "",
"text": "The tutorial asks\nA weaker version\n\n\n\n\nWho knows whom?\nwho communicates with whom\n\n\nWho owns what?\nwhich data each part holds\n\n\nWho decides how the system is wired?\nwhich part connects everything",
"text": "As asked here\nA weaker version\n\n\n\n\nWho knows whom?\nwho communicates with whom\n\n\nWho owns what?\nwhich data each part holds\n\n\nWho decides how the system is wired?\nwhich part connects everything",
"crumbs": [
"<span class='chapter-number'>1</span>  <span class='chapter-title'>[Step 0 — What the tutorial is about]{.en}[Étape 0 — De quoi parle le tutoriel]{.fr}[Schritt 0 — Worum es im Tutorial geht]{.de}</span>"
"<span class='chapter-number'>1</span>  <span class='chapter-title'>[Step 0 — What this is about]{.en}[Étape 0 — De quoi il s'agit]{.fr}[Schritt 0 — Worum es geht]{.de}</span>"
]
},
{
@@ -74,7 +64,7 @@
"href": "01-part-i-calls.html#sec-step-2",
"title": "2  Part I — Start with what you already know",
"section": "2.2 Step 2 — Three egoistic capabilities",
"text": "2.2 Step 2 — Three egoistic capabilities\nAn egoistic component says: I know what I can do, what data I accept and what data I produce — and I would rather not know the business process around me. Concretely, ConsoleIn must not contain rot13(...), and ROT13 must not contain consoleOut(...).\nRemoving those calls immediately creates a problem, which the tutorial states as a question: if nobody knows anybody, who makes this into a system? Note what the question does not say: the knowledge is not gone, it has to go somewhere else. Two connections are missing, not one — ConsoleIn ↔︎ ROT13 and ROT13 ↔︎ ConsoleOut.",
"text": "2.2 Step 2 — Three egoistic capabilities\nAn egoistic component says: I know what I can do, what data I accept and what data I produce — and I would rather not know the business process around me. Concretely, ConsoleIn must not contain rot13(...), and ROT13 must not contain consoleOut(...).\nRemoving those calls immediately creates a problem, best put as a question: if nobody knows anybody, who makes this into a system? Note what the question does not say: the knowledge is not gone, it has to go somewhere else. Two connections are missing, not one — ConsoleIn ↔︎ ROT13 and ROT13 ↔︎ ConsoleOut.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
@@ -84,7 +74,7 @@
"href": "01-part-i-calls.html#sec-step-3",
"title": "2  Part I — Start with what you already know",
"section": "2.3 Step 3 — Give every capability a mailbox",
"text": "2.3 Step 3 — Give every capability a mailbox\nThe smallest mechanism for the missing connections: a message and a named queue.\nrecord Message(String type, String value) {}\n\nMap&lt;String, BlockingQueue&lt;Message&gt;&gt; mailboxes = new ConcurrentHashMap&lt;&gt;();\n\nBlockingQueue&lt;Message&gt; mailbox(String name) {\n return mailboxes.computeIfAbsent(name, _ -&gt; new LinkedBlockingQueue&lt;&gt;());\n}\nThe tutorial insists on calling these mailboxes, not topics, and gives the reason: if two readers call take() on the same mailbox, they compete — each message goes to exactly one of them and is not copied to both. A topic, in Publish/Subscribe, would hand every subscriber its own copy. One reader per message is enough for now, and the limitation is kept on purpose: it is what makes it clear later what Publish/Subscribe actually adds.",
"text": "2.3 Step 3 — Give every capability a mailbox\nThe smallest mechanism for the missing connections: a message and a named queue.\nrecord Message(String type, String value) {}\n\nMap&lt;String, BlockingQueue&lt;Message&gt;&gt; mailboxes = new ConcurrentHashMap&lt;&gt;();\n\nBlockingQueue&lt;Message&gt; mailbox(String name) {\n return mailboxes.computeIfAbsent(name, _ -&gt; new LinkedBlockingQueue&lt;&gt;());\n}\nThese are mailboxes, not topics, and the distinction is worth insisting on: if two readers call take() on the same mailbox, they compete — each message goes to exactly one of them and is not copied to both. A topic, in Publish/Subscribe, would hand every subscriber its own copy. One reader per message is enough for now, and the limitation is kept on purpose: it is what makes it clear later what Publish/Subscribe actually adds.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
@@ -94,7 +84,7 @@
"href": "01-part-i-calls.html#sec-steps-4-6",
"title": "2  Part I — Start with what you already know",
"section": "2.4 Steps 4–6 — The three capabilities become egoistic",
"text": "2.4 Steps 4–6 — The three capabilities become egoistic\nEach capability now touches only its own mailbox names:\n\n\n\nCapability\nreads\nwrites\n\n\n\n\nConsoleIn\nthe keyboard\nconsoleIn.outbox\n\n\nROT13\nrot13.inbox\nrot13.outbox\n\n\nConsoleOut\nconsoleOut.inbox\nthe console\n\n\n\nNo capability contains the name of another. The tutorial’s own summary of the result: “three nicely isolated capabilities. And they do absolutely nothing together.” Nothing moves a message from consoleIn.outbox to rot13.inbox, or from rot13.outbox to consoleOut.inbox.",
"text": "2.4 Steps 4–6 — The three capabilities become egoistic\nEach capability now touches only its own mailbox names:\n\n\n\nCapability\nreads\nwrites\n\n\n\n\nConsoleIn\nthe keyboard\nconsoleIn.outbox\n\n\nROT13\nrot13.inbox\nrot13.outbox\n\n\nConsoleOut\nconsoleOut.inbox\nthe console\n\n\n\nNo capability contains the name of another, and that is exactly the result: three nicely isolated capabilities that do absolutely nothing together. Nothing moves a message from consoleIn.outbox to rot13.inbox, or from rot13.outbox to consoleOut.inbox.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
@@ -114,7 +104,7 @@
"href": "01-part-i-calls.html#sec-step-8",
"title": "2  Part I — Start with what you already know",
"section": "2.6 Step 8 — Ask again: who knows whom?",
"text": "2.6 Step 8 — Ask again: who knows whom?\nDoes ConsoleIn know ROT13? No. Does ROT13 know ConsoleIn or ConsoleOut? No. Has the topology disappeared? No — it sits in the two mediate(...) calls inside main().\nThis is the tutorial’s first major result:\n\nDecoupling often does not make knowledge disappear. It moves knowledge to where it belongs.\n\nThe capability “ROT13 transforms text” belongs to ROT13. The topology ConsoleIn → ROT13 → ConsoleOut belongs to system composition. What changed since step 1 is not that the wiring left main() — it is still there — but that it is no longer written inside a capability. It is now data: two pairs of mailbox names. Rewiring touches those two lines and no capability at all.",
"text": "2.6 Step 8 — Ask again: who knows whom?\nDoes ConsoleIn know ROT13? No. Does ROT13 know ConsoleIn or ConsoleOut? No. Has the topology disappeared? No — it sits in the two mediate(...) calls inside main().\nThis is the first major result:\n\nDecoupling often does not make knowledge disappear. It moves knowledge to where it belongs.\n\nThe capability “ROT13 transforms text” belongs to ROT13. The topology ConsoleIn → ROT13 → ConsoleOut belongs to system composition. What changed since step 1 is not that the wiring left main() — it is still there — but that it is no longer written inside a capability. It is now data: two pairs of mailbox names. Rewiring touches those two lines and no capability at all.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
@@ -124,7 +114,7 @@
"href": "01-part-i-calls.html#sec-step-9",
"title": "2  Part I — Start with what you already know",
"section": "2.7 Step 9 — Why virtual threads?",
"text": "2.7 Step 9 — Why virtual threads?\nFive loops now wait indefinitely: the keyboard, rot13.inbox, consoleOut.inbox and the two mediators’ sources. Virtual threads are simply the cheap Java way to let five waits happen at once inside one JVM.\nThey are an implementation convenience, not an architecture. The architecture — who knows whom, and where the wiring lives — is in the mailbox names, not in the threads. The tutorial’s own evidence for the separation: the same architecture will run as separate processes in step 11, with no threads shared between the parts.",
"text": "2.7 Step 9 — Why virtual threads?\nFive loops now wait indefinitely: the keyboard, rot13.inbox, consoleOut.inbox and the two mediators’ sources. Virtual threads are simply the cheap Java way to let five waits happen at once inside one JVM.\nThey are an implementation convenience, not an architecture. The architecture — who knows whom, and where the wiring lives — is in the mailbox names, not in the threads. The evidence for the separation: the same architecture will run as separate processes in step 11, with no threads shared between the parts.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
@@ -134,7 +124,7 @@
"href": "01-part-i-calls.html#sec-step-10",
"title": "2  Part I — Start with what you already know",
"section": "2.8 Step 10 — Keep the services egoistic",
"text": "2.8 Step 10 — Keep the services egoistic\nThe obvious shortcut: the first mediator only copies messages unchanged, so why not delete it and let ROT13 take() from consoleIn.outbox directly?\nBecause ROT13 would then contain the name consoleIn.outbox, which means it would know that ConsoleIn exists and where it publishes. The topology would move into ROT13, and ROT13 would stop being an egoistic capability. The test that makes this concrete: suppose the input comes from a new FileIn capability publishing to fileIn.outbox.\n\n\n\n\nwith the mediator\nwith the shortcut\n\n\n\n\nwhat changes\none argument of the mediator\nrunRot13 itself\n\n\nwho is touched\nno capability\nROT13, whose job did not change\n\n\n\nThe tutorial is honest about the price: this design “may look indirect — even a little odd”, and it promises a different way to keep services egoistic without a mediator in every message’s path.",
"text": "2.8 Step 10 — Keep the services egoistic\nThe obvious shortcut: the first mediator only copies messages unchanged, so why not delete it and let ROT13 take() from consoleIn.outbox directly?\nBecause ROT13 would then contain the name consoleIn.outbox, which means it would know that ConsoleIn exists and where it publishes. The topology would move into ROT13, and ROT13 would stop being an egoistic capability. The test that makes this concrete: suppose the input comes from a new FileIn capability publishing to fileIn.outbox.\n\n\n\n\nwith the mediator\nwith the shortcut\n\n\n\n\nwhat changes\none argument of the mediator\nrunRot13 itself\n\n\nwho is touched\nno capability\nROT13, whose job did not change\n\n\n\nThe price is worth stating plainly: this design may look indirect — even a little odd. There is another way to keep services egoistic without a mediator in every message’s path, and it comes later.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
@@ -144,7 +134,7 @@
"href": "01-part-i-calls.html#sec-part-i-result",
"title": "2  Part I — Start with what you already know",
"section": "2.9 What part I moved",
"text": "2.9 What part I moved\n\n\n\n\n\n\n\n\nstage\nwhere the topology lives\nwho could rewire it\n\n\n\n\nstep 1\ninside the capability code (IO.println(rot13(text)))\nwhoever edits that code\n\n\nsteps 7–8\nin main(), as pairs of mailbox names\nwhoever edits main()\n\n\n\nFunctionality: unchanged. Lines of code: more. Parts that know each other: none. That is the trade the rest of the tutorial keeps testing.",
"text": "2.9 What part I moved\n\n\n\n\n\n\n\n\nstage\nwhere the topology lives\nwho could rewire it\n\n\n\n\nstep 1\ninside the capability code (IO.println(rot13(text)))\nwhoever edits that code\n\n\nsteps 7–8\nin main(), as pairs of mailbox names\nwhoever edits main()\n\n\n\nFunctionality: unchanged. Lines of code: more. Parts that know each other: none. That is the trade everything that follows keeps testing.",
"crumbs": [
"<span class='chapter-number'>2</span>  <span class='chapter-title'>[Part I — Start with what you already know]{.en}[Partie I — Commencer par ce que l'on connaît déjà]{.fr}[Teil I — Mit dem beginnen, was man schon kennt]{.de}</span>"
]
@@ -154,7 +144,7 @@
"href": "02-part-ii-processes.html",
"title": "3  Part II — Cross the process boundary",
"section": "",
"text": "3.1 Step 11 — Separate the components\nSteps 11 to 18 take the architecture of part I and split it across five operating-system processes on one computer. The capabilities keep their mailbox names; only the transport underneath changes, from Java objects to files in directories. The first genuinely distributed problem shows up here, and it has nothing to do with ROT13.\nThree processes cannot share a BlockingQueue: every java command starts its own JVM with its own memory, so the mailboxes map would exist three times and each copy would see only its own messages. An external transport is needed.\nTCP would do, MQTT would do. The tutorial deliberately picks the most primitive option, the filesystem, and gives a one-line reason: because you can see it. Messages become files you can list with ls and read with cat while the system runs. Primitive here does not mean inferior; part VIII comes back to what the filesystem is genuinely good and bad at.",
"text": "3.1 Step 11 — Separate the components\nSteps 11 to 18 take the architecture of part I and split it across five operating-system processes on one computer. The capabilities keep their mailbox names; only the transport underneath changes, from Java objects to files in directories. The first genuinely distributed problem shows up here, and it has nothing to do with ROT13.\nThree processes cannot share a BlockingQueue: every java command starts its own JVM with its own memory, so the mailboxes map would exist three times and each copy would see only its own messages. An external transport is needed.\nTCP would do, MQTT would do. The most primitive option is picked deliberately, the filesystem, for a one-line reason: because you can see it. Messages become files you can list with ls and read with cat while the system runs. Primitive here does not mean inferior; part VIII comes back to what the filesystem is genuinely good and bad at.",
"crumbs": [
"<span class='chapter-number'>3</span>  <span class='chapter-title'>[Part II — Cross the process boundary]{.en}[Partie II — Franchir la frontière de processus]{.fr}[Teil II — Die Prozessgrenze überschreiten]{.de}</span>"
]
@@ -184,7 +174,7 @@
"href": "02-part-ii-processes.html#sec-step-15",
"title": "3  Part II — Cross the process boundary",
"section": "3.4 Step 15 — Observe a mailbox with WatchService",
"text": "3.4 Step 15 — Observe a mailbox with WatchService\nJava’s own filesystem observer supplies the consumer half: register a directory for ENTRY_CREATE, block in watcher.take(), and ignore every filename that does not end in .msg.\nThat also gives a low-tech injection tool. With ActuatorService running as the consumer:\nprintf 'TEXT\\nHello from a file' &gt; messageBoard/consoleOut/inbox/manual.tmp\nmv messageBoard/consoleOut/inbox/manual.tmp messageBoard/consoleOut/inbox/manual.msg\nObserved: nothing happens when the .tmp file appears; the line is printed the moment the rename creates the .msg name. Both accepted formats work, with and without the trailing timestamp.\nThe architectural lesson is the one the tutorial draws as producer → filesystem → consumer: the consumer could not tell a human typing mv from a real service. It knows its own inbox, not who writes into it. Egoism survived the process boundary.",
"text": "3.4 Step 15 — Observe a mailbox with WatchService\nJava’s own filesystem observer supplies the consumer half: register a directory for ENTRY_CREATE, block in watcher.take(), and ignore every filename that does not end in .msg.\nThat also gives a low-tech injection tool. With ActuatorService running as the consumer:\nprintf 'TEXT\\nHello from a file' &gt; messageBoard/consoleOut/inbox/manual.tmp\nmv messageBoard/consoleOut/inbox/manual.tmp messageBoard/consoleOut/inbox/manual.msg\nObserved: nothing happens when the .tmp file appears; the line is printed the moment the rename creates the .msg name. Both accepted formats work, with and without the trailing timestamp.\nThe architectural point reads producer → filesystem → consumer: the consumer could not tell a human typing mv from a real service. It knows its own inbox, not who writes into it. Egoism survived the process boundary.",
"crumbs": [
"<span class='chapter-number'>3</span>  <span class='chapter-title'>[Part II — Cross the process boundary]{.en}[Partie II — Franchir la frontière de processus]{.fr}[Teil II — Die Prozessgrenze überschreiten]{.de}</span>"
]
@@ -194,7 +184,7 @@
"href": "02-part-ii-processes.html#sec-steps-16-17",
"title": "3  Part II — Cross the process boundary",
"section": "3.5 Steps 16–17 — Services and mediator become processes",
"text": "3.5 Steps 16–17 — Services and mediator become processes\nThe three capabilities become three programs, and the mediator a fourth kind of program:\n\n\n\n\n\n\n\n\n\nprogram\nplays\nreads\nwrites\n\n\n\n\nSensorService.java\nConsoleIn\nthe keyboard\nconsoleIn/outbox\n\n\nProcessorService.java\nROT13\nrot13/inbox\nrot13/outbox\n\n\nActuatorService.java\nConsoleOut\nconsoleOut/inbox\nthe console\n\n\nMediator.java &lt;from&gt; &lt;to&gt;\nthe glue\n&lt;from&gt;\n&lt;to&gt;\n\n\n\nThe mediator is generic: its route is not compiled in, it arrives as two startup arguments. But the tutorial points at an asymmetry worth keeping in mind: the three capabilities receive their work as messages in a mailbox, while the mediator receives its route as startup configuration, and it has no name and no control mailbox of its own that anyone could write to.\nThe practical consequence: arguments are read once, so changing the route of a running mediator means stopping it and starting it again. A configuration file would be no different — it is still read at startup. The tutorial deliberately leaves this unfixed until the cost of the distributed mediators has been felt.",
"text": "3.5 Steps 16–17 — Services and mediator become processes\nThe three capabilities become three programs, and the mediator a fourth kind of program:\n\n\n\n\n\n\n\n\n\nprogram\nplays\nreads\nwrites\n\n\n\n\nSensorService.java\nConsoleIn\nthe keyboard\nconsoleIn/outbox\n\n\nProcessorService.java\nROT13\nrot13/inbox\nrot13/outbox\n\n\nActuatorService.java\nConsoleOut\nconsoleOut/inbox\nthe console\n\n\nMediator.java &lt;from&gt; &lt;to&gt;\nthe glue\n&lt;from&gt;\n&lt;to&gt;\n\n\n\nThe mediator is generic: its route is not compiled in, it arrives as two startup arguments. But there is an asymmetry worth keeping in mind: the three capabilities receive their work as messages in a mailbox, while the mediator receives its route as startup configuration, and it has no name and no control mailbox of its own that anyone could write to.\nThe practical consequence: arguments are read once, so changing the route of a running mediator means stopping it and starting it again. A configuration file would be no different — it is still read at startup. This stays deliberately unfixed until the cost of the distributed mediators has been felt.",
"crumbs": [
"<span class='chapter-number'>3</span>  <span class='chapter-title'>[Part II — Cross the process boundary]{.en}[Partie II — Franchir la frontière de processus]{.fr}[Teil II — Die Prozessgrenze überschreiten]{.de}</span>"
]
@@ -204,7 +194,7 @@
"href": "02-part-ii-processes.html#sec-step-18",
"title": "3  Part II — Cross the process boundary",
"section": "3.6 Step 18 — Run the fully external local version",
"text": "3.6 Step 18 — Run the fully external local version\nFive terminals, five processes, one local filesystem between them:\njava SensorService.java # terminal 1\njava Mediator.java consoleIn/outbox rot13/inbox # terminal 2\njava ProcessorService.java # terminal 3\njava Mediator.java rot13/outbox consoleOut/inbox # terminal 4\njava ActuatorService.java # terminal 5\nObserved: Hello World typed in terminal 1 appeared as Uryyb Jbeyq in terminal 5. The three middle terminals showed nothing new — each mediator prints one “Mediating: …” line at startup, and ProcessorService prints nothing at all. Afterwards each of the four mailbox directories held one .msg file: the same line, copied along the chain.\nCount it: five processes for what step 1 did in one statement. The tutorial’s instruction at this point is not to optimise: “We are not done making it painful.”\n\n\n\n\n\n\nFigure 3.1: The five processes and the four mailbox directories. In the web version, Play follows one line of text from the keyboard to the console.",
"text": "3.6 Step 18 — Run the fully external local version\nFive terminals, five processes, one local filesystem between them:\njava SensorService.java # terminal 1\njava Mediator.java consoleIn/outbox rot13/inbox # terminal 2\njava ProcessorService.java # terminal 3\njava Mediator.java rot13/outbox consoleOut/inbox # terminal 4\njava ActuatorService.java # terminal 5\nObserved: Hello World typed in terminal 1 appeared as Uryyb Jbeyq in terminal 5. The three middle terminals showed nothing new — each mediator prints one “Mediating: …” line at startup, and ProcessorService prints nothing at all. Afterwards each of the four mailbox directories held one .msg file: the same line, copied along the chain.\nCount it: five processes for what step 1 did in one statement. This is not the moment to optimise: it is not meant to be comfortable yet.\n\n\n\n\n\n\nFigure 3.1: The five processes and the four mailbox directories. In the web version, Play follows one line of text from the keyboard to the console.",
"crumbs": [
"<span class='chapter-number'>3</span>  <span class='chapter-title'>[Part II — Cross the process boundary]{.en}[Partie II — Franchir la frontière de processus]{.fr}[Teil II — Die Prozessgrenze überschreiten]{.de}</span>"
]
@@ -0,0 +1,34 @@
/* further — "to go further" notes: optional material, set apart in purple */
.further {
margin: 1.1rem 0;
padding: 0.5rem 0.9rem 0.6rem;
border: 1px solid color-mix(in srgb, var(--calc-furthercolor, #6B3FA0) 30%, transparent);
border-left: 3px solid var(--calc-furthercolor, #6B3FA0);
border-radius: 0.35rem;
background: color-mix(in srgb, var(--calc-furthercolor, #6B3FA0) 4%, transparent);
}
.further-head {
color: var(--calc-furthercolor, #6B3FA0);
font-weight: 600;
font-size: 0.92em;
margin-bottom: 0.35rem;
}
.further-body > p:first-child { margin-top: 0; }
.further-body > p:last-child { margin-bottom: 0; }
/* keep wide content inside the box, as .calc and .exo do */
.further mjx-container[display="true"],
.further .katex-display {
max-width: 100%;
overflow-x: auto;
overflow-y: hidden;
padding-bottom: 0.35em;
display: flex;
justify-content: center;
justify-content: safe center;
}
.further :is(pre, table) { max-width: 100%; overflow-x: auto; }
.further img, .further svg { max-width: 100%; }
@@ -32,9 +32,9 @@ mjx-container a {
padding: 0.5rem 0.75rem;
border: 1px solid var(--calc-notecolor, #B45309);
border-radius: 0.4rem;
background: var(--bs-body-bg, #fff);
background: var(--calc-surface, #fff);
color: var(--bs-body-color, #1a1a1a);
box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
box-shadow: 0 4px 14px var(--calc-shadow, rgba(0, 0, 0, 0.15));
font-size: 0.9em;
line-height: 1.4;
}
@@ -98,3 +98,18 @@
.calc-full { grid-column: 1 / 3; }
.calc-tag { grid-column: 1 / -1; }
}
/* --- interactive figures ------------------------------------------------
A figure that is dragged — a rotatable 3d view, a point moved with the
mouse — must not select its own labels while the pointer travels over
them: the browser would paint the axis names and captions as selected
text. The readouts and captions around the drawing stay selectable, so a
value can still be copied. The hooks are the ones every course's figure
scripts build into. */
[data-notes-fig] svg,
[data-notes-plot] svg,
[data-notes-fig] canvas,
[data-notes-plot] canvas {
-webkit-user-select: none;
user-select: none;
}
@@ -13,3 +13,58 @@
});
});
})();
// --- high contrast: a switch of its own, beside Quarto's light/dark one ----
// The class is already set before the first paint by the script calc-notes.lua
// puts in the head; this only builds the control and remembers a choice.
// Precedence: what the reader picked here, then `high-contrast: true` in the
// book, then the reader's system setting.
(function () {
var KEY = "notes-contrast";
var root = document.documentElement;
var LABELS = {
de: { on: "Hoher Kontrast aus", off: "Hoher Kontrast ein" },
fr: { on: "Désactiver le contraste élevé", off: "Activer le contraste élevé" },
en: { on: "Turn high contrast off", off: "Turn high contrast on" }
};
var lang = (root.lang || "en").slice(0, 2).toLowerCase();
var L = LABELS[lang] || LABELS.en;
function store(v) {
try { localStorage.setItem(KEY, v ? "more" : "normal"); } catch (e) {}
}
function paint() {
var on = root.classList.contains("hc");
document.querySelectorAll(".notes-contrast-toggle").forEach(function (b) {
b.setAttribute("aria-pressed", String(on));
b.setAttribute("title", on ? L.on : L.off);
b.setAttribute("aria-label", on ? L.on : L.off);
});
}
function build() {
var anchors = document.querySelectorAll(".quarto-color-scheme-toggle");
if (anchors.length === 0) return; // a page without Quarto's own tools
anchors.forEach(function (a) {
var b = document.createElement("button");
b.type = "button";
b.className = "quarto-navigation-tool px-1 notes-contrast-toggle";
// bootstrap-icons ships with these books; the glyph is the fallback
b.innerHTML = '<i class="bi bi-circle-half" aria-hidden="true"></i>';
b.addEventListener("click", function () {
var on = !root.classList.contains("hc");
root.classList.toggle("hc", on);
store(on);
paint();
});
a.parentNode.insertBefore(b, a.nextSibling);
});
paint();
}
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", build);
} else { build(); }
})();
@@ -0,0 +1,316 @@
/* high-contrast.css — the high-contrast pair, taken from GitHub's
"GitHub Light High Contrast" and "GitHub Dark High Contrast" VS Code
themes (the Primer `light_high_contrast` / `dark_high_contrast` scales).
It is switched by `hc` on <html>, which calc-notes.lua sets from
high-contrast: true
in the document metadata, and which the same in-header script sets for a
reader whose system asks for `prefers-contrast: more`. One class rather
than a class and a media query, so the palette below is written once.
It rides on top of the ordinary light/dark pair: `html.hc` restyles the
light theme, `html.hc body.quarto-dark` the night one, so the reader's own
light/dark toggle keeps working.
GitHub's two high-contrast themes separate things by outline rather than by
fill: text sits at full strength (fg.muted == fg.default), borders are
strong, and the tinted panels of the ordinary themes lose their tint. The
rules here do the same to the notes environments. */
/* ---------------------------------------------------------------- light -- */
html.hc {
/* Primer light_high_contrast */
--hc-canvas: #ffffff; /* canvas.default */
--hc-inset: #ffffff; /* canvas.inset — separation is by border */
--hc-fg: #0e1116; /* fg.default, and fg.muted, which equals it */
--hc-subtle: #66707b; /* fg.subtle — the only softened ink */
--hc-border: #20252c; /* border.default */
--hc-border-soft: #88929d; /* border.muted */
--hc-accent: #0349b4; /* accent.fg */
--hc-danger: #a0111f; /* danger.fg */
--hc-success: #055d20; /* success.fg */
--hc-attention: #4e2c00; /* attention.fg */
--hc-severe: #702c00; /* severe.fg */
--hc-done: #622cbc; /* done.fg */
/* the extension's own tokens */
--calc-ink: var(--hc-fg);
--calc-muted: var(--hc-fg);
--calc-line: var(--hc-border);
--calc-grid: var(--hc-border-soft);
--calc-accent-a: var(--hc-accent);
--calc-accent-b: var(--hc-severe);
--calc-accent-c: var(--hc-success);
--calc-danger: var(--hc-danger);
--calc-surface: var(--hc-canvas);
--calc-faint: var(--hc-border-soft);
--calc-shadow: rgba(14, 17, 22, 0.4);
--calc-domface: var(--hc-canvas);
--calc-domtop: #d8dee4;
--calc-notecolor: var(--hc-attention);
--calc-furthercolor: var(--hc-done);
/* the page itself */
--bs-body-bg: var(--hc-canvas);
--bs-body-color: var(--hc-fg);
--bs-emphasis-color: var(--hc-fg);
--bs-secondary-color: var(--hc-fg);
--bs-tertiary-color: var(--hc-subtle);
--bs-border-color: var(--hc-border);
--bs-link-color: var(--hc-accent);
--bs-link-hover-color: var(--hc-accent);
--bs-code-color: var(--hc-fg);
--bs-heading-color: var(--hc-fg);
}
/* ----------------------------------------------------------------- dark -- */
html.hc body.quarto-dark {
/* Primer dark_high_contrast, except for the canvas: the theme's own
#0a0c10 still reads as a very dark grey next to a black one, so the page
goes fully black and every other value keeps its relation to it. */
--hc-canvas: #000000; /* canvas.default is #0a0c10 upstream */
--hc-inset: #000000; /* canvas.inset */
--hc-subtle-bg: #272b33; /* canvas.subtle */
--hc-fg: #f0f3f6; /* fg.default == fg.muted */
--hc-subtle: #9ea7b3; /* fg.subtle */
--hc-border: #7a828e; /* border.default */
--hc-border-soft: #7a828e; /* border.muted — the same in this theme */
--hc-accent: #71b7ff; /* accent.fg */
--hc-danger: #ff9492; /* danger.fg */
--hc-success: #26cd4d; /* success.fg */
--hc-attention: #f0b72f; /* attention.fg */
--hc-severe: #ff803d; /* severe.fg */
--hc-done: #cb9eff; /* done.fg */
/* a stroke on near-black wants the text colour, not the border grey */
--calc-line: var(--hc-fg);
--calc-grid: var(--hc-border);
--calc-domface: var(--hc-subtle-bg);
--calc-domtop: #3d444d;
--calc-shadow: rgba(1, 4, 9, 0.8);
}
/* the tokens that only alias, so they follow whichever block is in force */
html.hc body.quarto-dark {
--calc-ink: var(--hc-fg);
--calc-muted: var(--hc-fg);
--calc-accent-a: var(--hc-accent);
--calc-accent-b: var(--hc-severe);
--calc-accent-c: var(--hc-success);
--calc-danger: var(--hc-danger);
--calc-surface: var(--hc-canvas);
--calc-faint: var(--hc-border);
--calc-notecolor: var(--hc-attention);
--calc-furthercolor: var(--hc-done);
--bs-body-bg: var(--hc-canvas);
--bs-body-color: var(--hc-fg);
--bs-emphasis-color: var(--hc-fg);
--bs-secondary-color: var(--hc-fg);
--bs-tertiary-color: var(--hc-subtle);
--bs-border-color: var(--hc-border);
--bs-link-color: var(--hc-accent);
--bs-link-hover-color: var(--hc-accent);
--bs-code-color: var(--hc-fg);
--bs-heading-color: var(--hc-fg);
}
/* --------------------------------------------------------- page chrome -- */
/* Quarto's own furniture is compiled from the bootswatch theme, so the
variables above do not reach all of it. */
html.hc body {
background-color: var(--hc-canvas);
color: var(--hc-fg);
}
html.hc :is(h1, h2, h3, h4, h5, h6, p, li, dt, dd, caption, figcaption, th, td) {
color: var(--hc-fg);
}
html.hc :is(.text-muted, .quarto-figure figcaption, figcaption.figure-caption,
.quarto-title-meta-heading, .quarto-title-meta-contents,
.callout-title-container, .footnotes) {
color: var(--hc-fg);
}
html.hc a:not(.nav-link):not(.sidebar-item-text) { color: var(--hc-accent); }
html.hc a:focus-visible,
html.hc button:focus-visible,
html.hc summary:focus-visible { outline: 2px solid var(--hc-accent); outline-offset: 2px; }
html.hc :is(#quarto-sidebar, #quarto-margin-sidebar, .sidebar, .sidebar-navigation,
#quarto-header, .navbar, .quarto-secondary-nav) {
background-color: var(--hc-canvas);
color: var(--hc-fg);
border-color: var(--hc-border);
}
html.hc :is(.sidebar-item-text, .sidebar .nav-link, nav[role="doc-toc"] a, .navbar .nav-link,
.quarto-secondary-nav .nav-link) {
color: var(--hc-fg);
opacity: 1;
}
html.hc .sidebar nav[role="doc-toc"] ul > li > a,
html.hc .sidebar-navigation .sidebar-item a,
html.hc .sidebar-navigation .sidebar-item .sidebar-item-text {
color: var(--hc-fg);
opacity: 1;
}
/* the active entry: Quarto writes its colour with !important, so this is the
one place the palette has to answer in kind */
html.hc .sidebar nav[role="doc-toc"] ul > li > a.active,
html.hc .sidebar nav[role="doc-toc"] ul > li > ul > li > a.active,
html.hc .sidebar nav[role="doc-toc"] ul > li > a:hover,
html.hc .sidebar-navigation .sidebar-item a.active,
html.hc .sidebar-navigation .sidebar-item a:hover {
color: var(--hc-accent) !important;
border-left-color: var(--hc-accent);
font-weight: 600;
}
html.hc nav[role="doc-toc"] { border-left: 1px solid var(--hc-border-soft); }
/* the breadcrumb of the collapsed header carries its own fill in both
bootswatch themes, and its ink is the weakest contrast on the page */
html.hc .breadcrumb {
background-color: var(--hc-canvas);
border: 1px solid var(--hc-border);
}
html.hc :is(.breadcrumb, .breadcrumb-item, .breadcrumb-item a, .quarto-btn-toggle) {
color: var(--hc-fg);
}
html.hc .breadcrumb-item a { color: var(--hc-accent); }
html.hc :is(hr, .quarto-title-block .quarto-title-banner, header#title-block-header) {
border-color: var(--hc-border);
}
html.hc hr { background-color: var(--hc-border); opacity: 1; }
html.hc blockquote {
border-left: 4px solid var(--hc-border);
color: var(--hc-fg);
}
html.hc :is(table, th, td) { border-color: var(--hc-border-soft); }
html.hc thead { border-bottom: 2px solid var(--hc-border); }
/* ------------------------------------------------------------- code ----- */
/* GitHub's high-contrast themes give a block an outline instead of a fill. */
html.hc :is(pre, div.sourceCode, pre.sourceCode) {
background-color: var(--hc-inset);
border: 1px solid var(--hc-border);
color: var(--hc-fg);
}
html.hc :not(pre) > code {
background-color: var(--hc-inset);
border: 1px solid var(--hc-border-soft);
border-radius: 3px;
color: var(--hc-fg);
padding: 0 0.2em;
}
html.hc code { color: var(--hc-fg); }
/* the syntax palette of the same two themes, mapped onto pandoc's classes */
html.hc code span:is(.co, .cv, .do, .an, .in) { color: var(--hc-subtle); font-style: italic; }
html.hc code span:is(.kw, .cf) { color: var(--hc-danger); }
html.hc code span:is(.st, .ch, .sc, .ss, .vs){ color: #032563; }
html.hc code span:is(.dv, .bn, .fl, .cn) { color: #023b95; }
html.hc code span:is(.fu, .ex) { color: #512598; }
html.hc code span:is(.va, .at) { color: var(--hc-severe); }
html.hc code span:is(.dt, .bu) { color: var(--hc-success); }
html.hc code span:is(.im, .pp) { color: var(--hc-severe); }
html.hc code span:is(.er, .wa, .al) { color: var(--hc-danger); font-weight: 600; }
html.hc code span:is(.op, .ot) { color: var(--hc-fg); }
html.hc body.quarto-dark code span:is(.st, .ch, .sc, .ss, .vs) { color: #addcff; }
html.hc body.quarto-dark code span:is(.dv, .bn, .fl, .cn) { color: #91cbff; }
html.hc body.quarto-dark code span:is(.fu, .ex) { color: #dbb7ff; }
html.hc body.quarto-dark code span:is(.co, .cv, .do, .an, .in) { color: #bdc4cc; }
/* ------------------------------------------- the notes environments ----- */
/* out goes the tint; the outline carries the box, at full accent strength */
html.hc :is(.exo, .further, .quiz, .gls-inline, .gls-float, .calc-note,
.exo-sol, .exo-hint, .quiz-opt) {
background: var(--hc-canvas);
}
html.hc .exo { border-color: var(--calc-notecolor); }
html.hc :is(.exo-sol, .exo-hint) { border-color: var(--calc-notecolor); }
html.hc .exo-head strong,
html.hc .exo-hint > summary { color: var(--calc-notecolor); }
html.hc .further { border-color: var(--calc-furthercolor); }
html.hc .gls-float { border-color: var(--calc-notecolor); box-shadow: 0 4px 14px var(--calc-shadow); }
html.hc :is(.gls-inline, .calc-note) { border-left-width: 4px; }
html.hc .gls-sym { text-decoration-color: var(--calc-notecolor); }
html.hc .quiz { --quiz-ok: var(--hc-success); --quiz-bad: var(--hc-danger); --quiz-ink: var(--hc-fg); }
html.hc :is(.quiz-opt.quiz-ok, .quiz-opt.quiz-bad) { background: var(--hc-canvas); }
html.hc .quiz-opt.quiz-ok { outline: 2px solid var(--hc-success); }
html.hc .quiz-opt.quiz-bad { outline: 2px solid var(--hc-danger); }
/* Quarto's own callouts, so a page does not mix outlined boxes with filled
ones; the callout keeps its colour, in its left bar and its title */
html.hc .callout {
background-color: var(--hc-canvas) !important;
border: 1px solid var(--hc-border);
}
html.hc .callout > .callout-header {
background-color: var(--hc-canvas) !important;
border-bottom: 1px solid var(--hc-border-soft);
}
html.hc :is(.callout-body, .callout-title-container, .callout-body-container p) {
color: var(--hc-fg);
}
html.hc .callout.callout-style-default > div.callout-header { font-weight: 600; }
/* Quarto's search box: its widget is not themed by the bootswatch pair, so it
stays white on a dark page unless it is told otherwise (see theme.css) */
html.hc :is(.aa-Form, .aa-InputWrapper, .aa-Panel, .aa-Item) {
background-color: var(--hc-canvas);
color: var(--hc-fg);
border-color: var(--hc-border);
}
html.hc :is(.aa-Autocomplete, .aa-DetachedFormContainer)
.aa-Form .aa-InputWrapper .aa-Input,
html.hc :is(.aa-Autocomplete, .aa-DetachedFormContainer)
.aa-Form .aa-InputWrapperSuffix .aa-ClearButton,
html.hc :is(.aa-Autocomplete, .aa-DetachedFormContainer)
.aa-Form .aa-InputWrapperPrefix :is(.aa-Label, .aa-LoadingIndicator) svg {
color: var(--hc-fg);
}
html.hc :is(.aa-Autocomplete, .aa-DetachedFormContainer)
.aa-Form .aa-InputWrapper .aa-Input::placeholder {
color: var(--hc-fg);
opacity: 0.75;
}
/* the results panel: Quarto colours the cards through an id, so this does too */
html.hc :is(.aa-DetachedOverlay, #quarto-search-results) li.aa-Item .search-item,
html.hc :is(.aa-DetachedOverlay, #quarto-search-results) li.aa-Item .search-item
:is(.search-result-title-container, .search-result-text-container,
.search-result-section, .search-result-text, .search-result-more) {
background-color: var(--hc-canvas);
color: var(--hc-fg);
}
html.hc :is(.aa-DetachedOverlay, #quarto-search-results) li.aa-Item[aria-selected="true"] .search-item,
html.hc :is(.aa-DetachedOverlay, #quarto-search-results) li.aa-Item[aria-selected="true"] .search-item
:is(.search-result-title-container, .search-result-text-container,
.search-result-section, .search-result-text, .search-result-more) {
background-color: var(--hc-accent);
color: var(--hc-canvas);
}
/* a hit is marked by weight and a rule, not by a block of colour */
html.hc :is(.aa-DetachedOverlay, #quarto-search-results) li.aa-Item .search-item
:is(mark.search-match, .search-match.mark) {
background-color: transparent;
color: inherit;
font-weight: 700;
text-decoration: underline;
}
/* the figure buttons of the animated schemes */
html.hc :is(.ns-btn, .nc-btn, .nd-replay) {
background: var(--hc-canvas);
color: var(--hc-fg);
border-color: var(--hc-border);
}
html.hc :is(.notes-spiral, .notes-cantor) :is(.ns-btn, .nc-btn)[aria-pressed="true"] {
background: var(--hc-canvas);
border-color: var(--hc-accent);
color: var(--hc-accent);
font-weight: 600;
}
/* the last tinted fills: a calc box and a note keep their outline instead */
html.hc :is(.calc-box, .calc-note, .calc-note[open]) { background: transparent; }
@@ -0,0 +1,50 @@
/* narrow.css — the book on a phone.
Nothing in the flow may be wider than the screen: a wide formula, table or
figure scrolls inside its own box instead of pushing the whole page
sideways (which leaves the text cut off at the left edge).
Loaded with calc-notes.css, so every page of every book gets it. */
/* --- display maths ------------------------------------------------------
The boxes of this extension (.calc, .exo, .further) already scroll their
own maths; this covers every other display formula on the page. */
:is(main, .quarto-title-block) :is(mjx-container[display="true"], .math.display) {
max-width: 100%;
overflow-x: auto;
overflow-y: hidden; /* Firefox computes phantom vertical overflow */
padding-bottom: 0.35em; /* keep descenders clear of a scrollbar */
/* a centred formula that overflows would hide its left side out of reach,
so centre it only while it fits */
justify-content: safe center;
}
/* --- everything else that can be wider than a phone ---------------------- */
main :is(pre, .sourceCode) { max-width: 100%; overflow-x: auto; }
main :is(img, svg) { max-width: 100%; height: auto; }
main table:not(.ltx-table) { display: block; max-width: 100%; overflow-x: auto; }
/* the animated figures of lesson-style chapters */
.notes-cantor, .notes-spiral, .notes-dominos { max-width: 100%; overflow-x: auto; }
/* the glossary popup: never wider than the screen */
.gls-float { max-width: min(92vw, 26rem); }
/* --- phone-sized screens ------------------------------------------------- */
@media (max-width: 575.98px) {
/* the equation number of a labelled calc block goes under the line, so the
formula keeps the full width */
.calc { grid-template-columns: max-content 1fr; }
/* figure captions and the fold summaries read better tight */
.exo, .further { padding-left: 0.6rem; padding-right: 0.6rem; }
/* A bare url in prose, or a long identifier in a code span, is one word to
the line breaker and paints past its block on a narrow screen — no
element is oversized, so only the text itself overflows. */
#quarto-document-content :is(a, code) { overflow-wrap: break-word; }
/* Quarto's own previous/next footer: the chapter titles are laid out in a
row that will not shrink, so a long title pushes the page sideways. */
.page-navigation { flex-wrap: wrap; row-gap: 0.75em; }
.nav-page, .nav-page .nav-page-text { min-width: 0; }
.nav-page .chapter-title { overflow-wrap: break-word; }
}
@@ -0,0 +1,129 @@
/* theme.css — one palette for every part of the notes extension, in light
mode, in night mode and in high contrast.
Night mode keys off Quarto's own `body.quarto-dark`, which the light/dark
toggle sets — never off `prefers-color-scheme`, so a book configured
light-only stays light for a reader whose system is dark.
A book opts in with, in _quarto.yml:
format:
html:
theme:
light: [cosmo]
dark: [darkly]
High contrast is a separate sheet, high-contrast.css, after GitHub's two
high-contrast VS Code themes. It keys off `hc` on <html>, which
calc-notes.lua sets from `high-contrast: true` in the metadata and for a
reader whose system asks for `prefers-contrast: more`.
Loaded with calc-notes.css, so every page of every book has these tokens. */
:root {
--calc-ink: #1a1a1a; /* figure text, strong strokes */
--calc-muted: #57606a; /* captions, readouts, button text */
--calc-line: #444444; /* axes and rules */
--calc-grid: #cccccc; /* lattice dots, faint grid */
--calc-accent-a: #1F6FB4; /* lineA of the tikz preamble */
--calc-accent-b: #D1541F; /* lineB */
--calc-accent-c: #2E8B57; /* lineC */
--calc-danger: #B91C1C; /* an error state, e.g. a failed code run */
--calc-surface: var(--bs-body-bg, #ffffff);
--calc-faint: #e7e9ec; /* hairlines between rows */
--calc-shadow: rgba(0, 0, 0, 0.15); /* floats above the page */
--calc-domface: #DCE7F2; /* the domino figure's front face */
--calc-domtop: #B8CFE4; /* its top face */
/* --calc-notecolor-src and --calc-furthercolor-src come from the document
metadata (calc-notes.lua / further.lua) and are the book's own colours;
--calc-notecolor and --calc-furthercolor are what everything draws with,
and equal the source here. The dark block lifts them. */
}
body.quarto-dark {
--calc-ink: #e6e9ed;
--calc-muted: #9aa4b2;
--calc-line: #b6bec7;
--calc-grid: #4b535d;
--calc-accent-a: #6fb0ea;
--calc-accent-b: #f0956a;
--calc-accent-c: #64c49a;
--calc-danger: #f08a8a;
--calc-faint: #3a4049;
--calc-shadow: rgba(0, 0, 0, 0.55);
--calc-domface: #2b3b4d;
--calc-domtop: #365070;
/* The book's own accent is kept, not replaced: its print value is too dim
on a dark ground, so it is lifted to a light tone at the same hue rather
than swapped for a generic amber. A book that wants a specific night
value sets `notecolor-dark:` / `furthercolor-dark:` in its metadata.
On a browser without relative colour syntax the lift is dropped and the
book's own colour is used unchanged. */
--calc-notecolor:
var(--calc-notecolor-dark,
oklch(from var(--calc-notecolor-src, #B45309) 0.78 c h));
--calc-furthercolor:
var(--calc-furthercolor-dark,
oklch(from var(--calc-furthercolor-src, #6B3FA0) 0.80 c h));
}
/* --- generated line art -------------------------------------------------
The tikz figures are black-and-colour line drawings on transparent white.
Inverting them keeps the drawing readable and, with the hue rotation,
keeps blue blue and orange orange. Photographs live under img/ and are
left alone; an svg that is a photograph, or that carries its own dark
palette, opts out with class="no-invert". */
body.quarto-dark main img[src$=".svg"]:not(.no-invert) {
filter: invert(1) hue-rotate(180deg);
}
/* --- higher contrast ---------------------------------------------------
The high-contrast pair lives in high-contrast.css, which is loaded with
this file and keys off `hc` on <html>. */
/* --- Quarto's search box -------------------------------------------------
The search widget keeps its own white surface whatever the bootswatch
theme says, so on a dark page it is a white slab with dark text. It is
given the page's own surface here rather than in each book. */
body.quarto-dark :is(.aa-Form, .aa-InputWrapper, .aa-Panel, .aa-Item,
.aa-DetachedContainer, .aa-DetachedFormContainer) {
background-color: var(--calc-surface, #222);
color: var(--calc-ink, #e6e9ed);
border-color: var(--calc-faint, #3a4049);
}
/* The ink inside the form is a separate problem from its surface: Quarto's
dark bundle sets the input, its placeholder, the clear button and the
magnifier to rgb(45,45,45) through a four-class selector, so a short one
loses the cascade and the typed text stays unreadable. The shape below
matches Quarto's own, which is the only way to win without !important. */
body.quarto-dark :is(.aa-Autocomplete, .aa-DetachedFormContainer)
.aa-Form .aa-InputWrapper .aa-Input,
body.quarto-dark :is(.aa-Autocomplete, .aa-DetachedFormContainer)
.aa-Form .aa-InputWrapperSuffix .aa-ClearButton,
body.quarto-dark :is(.aa-Autocomplete, .aa-DetachedFormContainer)
.aa-Form .aa-InputWrapperPrefix :is(.aa-Label, .aa-LoadingIndicator) svg {
color: var(--calc-ink, #e6e9ed);
}
body.quarto-dark :is(.aa-Autocomplete, .aa-DetachedFormContainer)
.aa-Form .aa-InputWrapper .aa-Input::placeholder {
color: var(--calc-muted, #9aa4b2);
}
/* --- the high-contrast switch -------------------------------------------
Built by calc-notes.js next to Quarto's light/dark toggle, and styled to
sit with it rather than stand out. */
.notes-contrast-toggle {
background: none;
border: 0;
color: inherit;
line-height: 1;
cursor: pointer;
opacity: 0.85;
}
.notes-contrast-toggle:hover { opacity: 1; }
.notes-contrast-toggle[aria-pressed="true"] {
opacity: 1;
color: var(--calc-accent-a, #1F6FB4);
}
.notes-contrast-toggle:focus-visible {
outline: 2px solid var(--calc-accent-a, #1F6FB4);
outline-offset: 2px;
}
@@ -160,13 +160,11 @@
/* ---- dark theme ----------------------------------------------------- */
@media (prefers-color-scheme: dark) {
.quiz {
body.quarto-dark .quiz {
--quiz-ok: #4cb08a;
--quiz-bad: #e2798f;
--quiz-ink: #8b98a8;
}
}
/* ---- print ----------------------------------------------------------
* Printing the HTML is a fallback (the pdf format is the real print path).