Rename book to Process Control
This commit is contained in:
1 parent
919e79eb2a
commit
afb816f459
53 files changed
+5587
-503
No files matched your search
@@ -7,7 +7,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
|
||||
|
||||
<title>1 Étape 0 — De quoi parle le tutoriel – De l'appel à l'événement</title>
|
||||
<title>1 É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> <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> <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> <span class="chapter-title">Étape 0 — De quoi parle le tutoriel</span></span></a>
|
||||
<span class="menu-text"><span class="chapter-number">1</span> <span class="chapter-title">Étape 0 — De quoi il s’agit</span></span></a>
|
||||
</div>
|
||||
</li>
|
||||
<li class="sidebar-item">
|
||||
@@ -286,6 +332,23 @@ ul.task-list li input[type="checkbox"] {
|
||||
<span class="menu-text"><span class="chapter-number">3</span> <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>
|
||||
</nav>
|
||||
@@ -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> <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> <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>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
|
||||
|
||||
<title>2 Partie I — Commencer par ce que l’on connaît déjà – De l'appel à l'événement</title>
|
||||
<title>2 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> <span class="chapter-title">Étape 0 — De quoi parle le tutoriel</span></span></a>
|
||||
<span class="menu-text"><span class="chapter-number">1</span> <span class="chapter-title">Étape 0 — De quoi il s’agit</span></span></a>
|
||||
</div>
|
||||
</li>
|
||||
<li class="sidebar-item">
|
||||
@@ -321,6 +367,23 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
|
||||
<span class="menu-text"><span class="chapter-number">3</span> <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>
|
||||
</nav>
|
||||
@@ -398,7 +461,7 @@ Figure 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 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"><</span>Message<span class="op">></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">-></span> <span class="kw">new</span> <span class="bu">LinkedBlockingQueue</span><span class="op"><>());</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 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 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 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 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 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 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> <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> <span class="chapter-title">Étape 0 — De quoi il s’agit</span></span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="nav-page nav-page-next">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||||
|
||||
|
||||
<title>3 Partie II — Franchir la frontière de processus – De l'appel à l'événement</title>
|
||||
<title>3 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> <span class="chapter-title">Étape 0 — De quoi parle le tutoriel</span></span></a>
|
||||
<span class="menu-text"><span class="chapter-number">1</span> <span class="chapter-title">Étape 0 — De quoi il s’agit</span></span></a>
|
||||
</div>
|
||||
</li>
|
||||
<li class="sidebar-item">
|
||||
@@ -320,6 +367,23 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
|
||||
<span class="menu-text"><span class="chapter-number">3</span> <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>
|
||||
</nav>
|
||||
@@ -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">></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 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.
@@ -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
@@ -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> <span class="chapter-title">Étape 0 — De quoi parle le tutoriel</span></span></a>
|
||||
<span class="menu-text"><span class="chapter-number">1</span> <span class="chapter-title">Étape 0 — De quoi il s’agit</span></span></a>
|
||||
</div>
|
||||
</li>
|
||||
<li class="sidebar-item">
|
||||
@@ -321,6 +332,23 @@ pre > code.sourceCode > span > a:first-child::before { text-decoration: underlin
|
||||
<span class="menu-text"><span class="chapter-number">3</span> <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>
|
||||
</nav>
|
||||
@@ -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> <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> <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
@@ -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<String, BlockingQueue<Message>> mailboxes = new ConcurrentHashMap<>();\n\nBlockingQueue<Message> mailbox(String name) {\n return mailboxes.computeIfAbsent(name, _ -> new LinkedBlockingQueue<>());\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<String, BlockingQueue<Message>> mailboxes = new ConcurrentHashMap<>();\n\nBlockingQueue<Message> mailbox(String name) {\n return mailboxes.computeIfAbsent(name, _ -> new LinkedBlockingQueue<>());\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' > 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' > 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 <from> <to>\nla colle\n<from>\n<to>\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 <from> <to>\nla colle\n<from>\n<to>\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;
|
||||
});
|
||||
})();
|
||||
Reference in new issue
Block a user