Added course's notes
No files matched your search
@@ -0,0 +1,206 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
figures/build-figures.py -- one drawing, three languages.
|
||||
|
||||
Each diagram is written once, as an SVG in figures/src/ whose labels are
|
||||
{{key}} placeholders. figures/labels.yml gives every key its en/fr/de
|
||||
string. For each language this writes
|
||||
|
||||
figures/<name>-<lang>.svg for the html book
|
||||
figures/<name>-<lang>.pdf for the pdf book (via rsvg-convert)
|
||||
|
||||
and a chapter refers to the pair without an extension, so each format picks
|
||||
the file it can use:
|
||||
|
||||
{#fig-...}
|
||||
|
||||
The svg keeps the labels as real <text> nodes rather than outlines, which is
|
||||
the whole reason for not going through TikZ: the text stays selectable and
|
||||
searchable, the reader's find-in-page reaches it, and figures/diagram.css --
|
||||
injected into every built svg -- can restyle it, including a dark theme that
|
||||
follows the page. rsvg-convert applies the same stylesheet when it makes the
|
||||
pdf, minus the dark-mode block, so print gets the light theme.
|
||||
|
||||
German labels run long. A key may therefore carry a per-language font size,
|
||||
which overrides the class default for that one label:
|
||||
|
||||
key: {en: "Primary key", de: {text: "Primärschlüssel", size: 10}}
|
||||
|
||||
python3 figures/build-figures.py build what changed
|
||||
python3 figures/build-figures.py --force rebuild everything
|
||||
python3 figures/build-figures.py --check report only, build nothing
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import yaml
|
||||
|
||||
LANGS = ("en", "fr", "de")
|
||||
|
||||
HERE = Path(__file__).resolve().parent
|
||||
SRC = HERE / "src"
|
||||
LABELS = HERE / "labels.yml"
|
||||
CSS = HERE / "diagram.css"
|
||||
|
||||
PLACEHOLDER = re.compile(r"\{\{\s*([A-Za-z0-9_.-]+)\s*\}\}")
|
||||
STYLE_SLOT = "<!--CSS-->"
|
||||
|
||||
|
||||
# --------------------------------------------------------------- label table
|
||||
|
||||
def load_labels() -> dict:
|
||||
if not LABELS.exists():
|
||||
return {}
|
||||
return yaml.safe_load(LABELS.read_text(encoding="utf-8")) or {}
|
||||
|
||||
|
||||
def resolve(entry, lang: str, key: str, name: str):
|
||||
"""One label -> (text, font-size or None). Falls back to en, then the key."""
|
||||
if entry is None:
|
||||
return None, None
|
||||
if isinstance(entry, str):
|
||||
return entry, None
|
||||
if not isinstance(entry, dict):
|
||||
return str(entry), None
|
||||
|
||||
value = entry.get(lang)
|
||||
if value is None:
|
||||
value = entry.get("en")
|
||||
if value is None:
|
||||
return None, None
|
||||
print(f"figures: {name}: no '{lang}' label for '{key}' -- using English",
|
||||
file=sys.stderr)
|
||||
|
||||
if isinstance(value, dict):
|
||||
return str(value.get("text", "")), value.get("size")
|
||||
return str(value), None
|
||||
|
||||
|
||||
XML_ESCAPE = {"&": "&", "<": "<", ">": ">"}
|
||||
|
||||
|
||||
def escape(text: str) -> str:
|
||||
out = []
|
||||
for ch in text:
|
||||
out.append(XML_ESCAPE.get(ch, ch))
|
||||
return "".join(out)
|
||||
|
||||
|
||||
def substitute(svg: str, table: dict, lang: str, name: str) -> tuple[str, int]:
|
||||
"""Replace every {{key}}. Returns the svg and the number of keys missed."""
|
||||
missed = 0
|
||||
sizes: dict[str, float] = {}
|
||||
|
||||
def one(match: re.Match) -> str:
|
||||
nonlocal missed
|
||||
key = match.group(1)
|
||||
text, size = resolve(table.get(key), lang, key, name)
|
||||
if text is None:
|
||||
missed += 1
|
||||
print(f"figures: {name}: no label for '{key}' -- add it to labels.yml",
|
||||
file=sys.stderr)
|
||||
return escape("{{" + key + "}}")
|
||||
if size is not None:
|
||||
sizes[key] = size
|
||||
return escape(text)
|
||||
|
||||
svg = PLACEHOLDER.sub(one, svg)
|
||||
|
||||
# a per-language size rides along as a style on the element carrying the
|
||||
# label, matched by its data-label attribute
|
||||
if sizes:
|
||||
rules = "\n".join(
|
||||
f' [data-label="{k}"] {{ font-size: {v}px; }}' for k, v in sizes.items()
|
||||
)
|
||||
svg = svg.replace(STYLE_SLOT, STYLE_SLOT + "\n" + rules, 1)
|
||||
return svg, missed
|
||||
|
||||
|
||||
# ------------------------------------------------------------------- building
|
||||
|
||||
def newer(target: Path, *sources: Path) -> bool:
|
||||
"""True when target is missing or older than any source."""
|
||||
if not target.exists():
|
||||
return True
|
||||
stamp = target.stat().st_mtime
|
||||
return any(s.exists() and s.stat().st_mtime > stamp for s in sources)
|
||||
|
||||
|
||||
def build(force: bool = False, check: bool = False) -> int:
|
||||
if not SRC.is_dir():
|
||||
print(f"figures: no {SRC.relative_to(HERE.parent)}/ -- nothing to build")
|
||||
return 0
|
||||
|
||||
table_all = load_labels()
|
||||
css = CSS.read_text(encoding="utf-8") if CSS.exists() else ""
|
||||
sources = sorted(SRC.glob("*.svg"))
|
||||
if not sources:
|
||||
print("figures: figures/src/ holds no .svg -- nothing to build")
|
||||
return 0
|
||||
|
||||
problems = 0
|
||||
built = 0
|
||||
for src in sources:
|
||||
name = src.stem
|
||||
table = table_all.get(name, {})
|
||||
if not isinstance(table, dict):
|
||||
print(f"figures: labels.yml: '{name}' is not a mapping", file=sys.stderr)
|
||||
problems += 1
|
||||
continue
|
||||
|
||||
raw = src.read_text(encoding="utf-8")
|
||||
for lang in LANGS:
|
||||
svg_out = HERE / f"{name}-{lang}.svg"
|
||||
pdf_out = HERE / f"{name}-{lang}.pdf"
|
||||
|
||||
if not force and not newer(svg_out, src, LABELS, CSS) \
|
||||
and not newer(pdf_out, src, LABELS, CSS):
|
||||
continue
|
||||
if check:
|
||||
print(f"figures: {name}-{lang} would be rebuilt")
|
||||
built += 1
|
||||
continue
|
||||
|
||||
svg, missed = substitute(raw, table, lang, name)
|
||||
problems += missed
|
||||
# CDATA, so a "<" or "&" written in the stylesheet (in a comment,
|
||||
# say) cannot turn into markup and break the parse
|
||||
svg = svg.replace(STYLE_SLOT, f"<![CDATA[\n{css}\n]]>", 1)
|
||||
svg_out.write_text(svg, encoding="utf-8")
|
||||
|
||||
try:
|
||||
subprocess.run(
|
||||
["rsvg-convert", "-f", "pdf", "-o", str(pdf_out), str(svg_out)],
|
||||
check=True, capture_output=True,
|
||||
)
|
||||
except FileNotFoundError:
|
||||
print("figures: rsvg-convert not found -- the pdf book will be "
|
||||
"missing its figures (sudo pacman -S librsvg)", file=sys.stderr)
|
||||
return 1
|
||||
except subprocess.CalledProcessError as exc:
|
||||
print(f"figures: {name}-{lang}: pdf failed -- "
|
||||
f"{exc.stderr.decode(errors='replace').strip()}", file=sys.stderr)
|
||||
problems += 1
|
||||
continue
|
||||
built += 1
|
||||
print(f"figures: built {name}-{lang}")
|
||||
|
||||
if not built:
|
||||
print("figures: up to date")
|
||||
elif not check:
|
||||
print(f"figures: {built} file(s) built")
|
||||
return 1 if problems else 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
args = set(sys.argv[1:])
|
||||
unknown = args - {"--force", "--check"}
|
||||
if unknown:
|
||||
print(f"figures: unknown option {' '.join(sorted(unknown))}", file=sys.stderr)
|
||||
sys.exit(2)
|
||||
sys.exit(build(force="--force" in args, check="--check" in args))
|
||||
@@ -0,0 +1,113 @@
|
||||
/* figures/diagram.css -- shared look of every built figure.
|
||||
*
|
||||
* build-figures.py drops this file into the style element of every built
|
||||
* svg, so a figure carries its own styling and stays self-contained.
|
||||
* Classes, not per-element fills, do the work: one edit here restyles the
|
||||
* whole book.
|
||||
*
|
||||
* The palette is theme.scss's: teal #20666f for structure, amber #8a5a08 for
|
||||
* the warning accent, ink #1b2430 for text, IBM Plex to match the page.
|
||||
*
|
||||
* Dark theme: the @media block follows the reader's system setting. librsvg
|
||||
* ignores media queries when it makes the pdf, so print always gets the light
|
||||
* theme -- which is what a printed page wants.
|
||||
*/
|
||||
|
||||
svg {
|
||||
font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
|
||||
/* the figure sits on the page, not on a white card of its own */
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
/* ---- surfaces ------------------------------------------------------- */
|
||||
|
||||
.box { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
||||
.box-weak { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
||||
.box-accent { fill: #e5eff1; stroke: #20666f; stroke-width: 1.8; }
|
||||
.box-warn { fill: #f8f1e0; stroke: #8a5a08; stroke-width: 1.4; }
|
||||
.box-plain { fill: #fbfcfd; stroke: #dae0e8; stroke-width: 1.2; }
|
||||
.diamond { fill: #e5eff1; stroke: #20666f; stroke-width: 1.4; }
|
||||
.ellipse { fill: #fbfcfd; stroke: #5a6879; stroke-width: 1.2; }
|
||||
|
||||
/* ---- lines ---------------------------------------------------------- */
|
||||
|
||||
.edge { fill: none; stroke: #5a6879; stroke-width: 1.3; }
|
||||
.edge-strong{ fill: none; stroke: #20666f; stroke-width: 1.8; }
|
||||
.edge-warn { fill: none; stroke: #8a5a08; stroke-width: 1.6; }
|
||||
.edge-dash { fill: none; stroke: #5a6879; stroke-width: 1.2; stroke-dasharray: 5 3; }
|
||||
.rule { stroke: #dae0e8; stroke-width: 1; }
|
||||
|
||||
/* ---- text ----------------------------------------------------------- */
|
||||
|
||||
.t { fill: #1b2430; font-size: 13px; }
|
||||
.t-sm { fill: #1b2430; font-size: 11px; }
|
||||
.t-lead { fill: #1b2430; font-size: 14px; font-weight: 600; }
|
||||
.t-mut { fill: #5a6879; font-size: 11px; }
|
||||
.t-key { fill: #1b2430; font-size: 12px; text-decoration: underline; }
|
||||
.t-accent { fill: #20666f; font-size: 12px; font-weight: 600; }
|
||||
.t-warn { fill: #8a5a08; font-size: 12px; font-weight: 600; }
|
||||
.t-mono { fill: #1b2430; font-size: 11.5px;
|
||||
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
|
||||
|
||||
.mid { text-anchor: middle; }
|
||||
.end { text-anchor: end; }
|
||||
|
||||
/* ---- interaction ====================================================
|
||||
* A .node groups one box with its labels. Hovering it lifts the whole group
|
||||
* a little, which is enough to follow a path through a busy diagram without
|
||||
* any script. Pointer events stay off the decorative layers so the hover
|
||||
* target is the shape itself.
|
||||
*/
|
||||
|
||||
.node { transition: opacity .12s ease; }
|
||||
.node:hover .box,
|
||||
.node:hover .box-accent,
|
||||
.node:hover .diamond { stroke-width: 2.6; }
|
||||
.node:hover .t, .node:hover .t-lead { fill: #20666f; }
|
||||
|
||||
svg:hover .node:not(:hover) { opacity: .55; }
|
||||
|
||||
/* a figure that marks no nodes must not dim on hover */
|
||||
svg:not(:has(.node)) .node { opacity: 1; }
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.node { transition: none; }
|
||||
}
|
||||
|
||||
/* ---- dark theme ------------------------------------------------------ */
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.box { fill: #1d2b33; stroke: #4c9aa5; }
|
||||
.box-weak { fill: #1d2b33; stroke: #4c9aa5; }
|
||||
.box-accent { fill: #24363d; stroke: #4c9aa5; }
|
||||
.box-warn { fill: #332a18; stroke: #c99a3a; }
|
||||
.box-plain { fill: #161b22; stroke: #30363d; }
|
||||
.diamond { fill: #24363d; stroke: #4c9aa5; }
|
||||
.ellipse { fill: #161b22; stroke: #8b98a8; }
|
||||
|
||||
.edge { stroke: #8b98a8; }
|
||||
.edge-strong{ stroke: #4c9aa5; }
|
||||
.edge-warn { stroke: #c99a3a; }
|
||||
.edge-dash { stroke: #8b98a8; }
|
||||
.rule { stroke: #30363d; }
|
||||
|
||||
.t, .t-sm, .t-lead, .t-key, .t-mono { fill: #e6edf3; }
|
||||
.t-mut { fill: #8b98a8; }
|
||||
.t-accent { fill: #4c9aa5; }
|
||||
.t-warn { fill: #c99a3a; }
|
||||
|
||||
.node:hover .t, .node:hover .t-lead { fill: #7fc4cf; }
|
||||
|
||||
.arrow { fill: #8b98a8; }
|
||||
.arrow-strong { fill: #4c9aa5; }
|
||||
.arrow-warn { fill: #c99a3a; }
|
||||
}
|
||||
|
||||
/* ---- arrowheads ======================================================
|
||||
* marker contents cannot inherit the referencing element's fill, so each
|
||||
* arrowhead is its own class and is themed alongside the line it ends.
|
||||
*/
|
||||
|
||||
.arrow { fill: #5a6879; }
|
||||
.arrow-strong { fill: #20666f; }
|
||||
.arrow-warn { fill: #8a5a08; }
|
||||
@@ -0,0 +1,156 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 760 230" width="760" height="230"
|
||||
role="img" aria-labelledby="dc-title">
|
||||
<title id="dc-title">Die prozedurale Fassung: in einem einzigen main() wird IO.readln() aufgerufen, dessen Ergebnis an rot13() übergeben und dieses Ergebnis an IO.println(). Ein Thread, ein Prozess, drei direkte Aufrufe.</title>
|
||||
<style><![CDATA[
|
||||
/* figures/diagram.css -- shared look of every built figure.
|
||||
*
|
||||
* build-figures.py drops this file into the style element of every built
|
||||
* svg, so a figure carries its own styling and stays self-contained.
|
||||
* Classes, not per-element fills, do the work: one edit here restyles the
|
||||
* whole book.
|
||||
*
|
||||
* The palette is theme.scss's: teal #20666f for structure, amber #8a5a08 for
|
||||
* the warning accent, ink #1b2430 for text, IBM Plex to match the page.
|
||||
*
|
||||
* Dark theme: the @media block follows the reader's system setting. librsvg
|
||||
* ignores media queries when it makes the pdf, so print always gets the light
|
||||
* theme -- which is what a printed page wants.
|
||||
*/
|
||||
|
||||
svg {
|
||||
font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
|
||||
/* the figure sits on the page, not on a white card of its own */
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
/* ---- surfaces ------------------------------------------------------- */
|
||||
|
||||
.box { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
||||
.box-weak { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
||||
.box-accent { fill: #e5eff1; stroke: #20666f; stroke-width: 1.8; }
|
||||
.box-warn { fill: #f8f1e0; stroke: #8a5a08; stroke-width: 1.4; }
|
||||
.box-plain { fill: #fbfcfd; stroke: #dae0e8; stroke-width: 1.2; }
|
||||
.diamond { fill: #e5eff1; stroke: #20666f; stroke-width: 1.4; }
|
||||
.ellipse { fill: #fbfcfd; stroke: #5a6879; stroke-width: 1.2; }
|
||||
|
||||
/* ---- lines ---------------------------------------------------------- */
|
||||
|
||||
.edge { fill: none; stroke: #5a6879; stroke-width: 1.3; }
|
||||
.edge-strong{ fill: none; stroke: #20666f; stroke-width: 1.8; }
|
||||
.edge-warn { fill: none; stroke: #8a5a08; stroke-width: 1.6; }
|
||||
.edge-dash { fill: none; stroke: #5a6879; stroke-width: 1.2; stroke-dasharray: 5 3; }
|
||||
.rule { stroke: #dae0e8; stroke-width: 1; }
|
||||
|
||||
/* ---- text ----------------------------------------------------------- */
|
||||
|
||||
.t { fill: #1b2430; font-size: 13px; }
|
||||
.t-sm { fill: #1b2430; font-size: 11px; }
|
||||
.t-lead { fill: #1b2430; font-size: 14px; font-weight: 600; }
|
||||
.t-mut { fill: #5a6879; font-size: 11px; }
|
||||
.t-key { fill: #1b2430; font-size: 12px; text-decoration: underline; }
|
||||
.t-accent { fill: #20666f; font-size: 12px; font-weight: 600; }
|
||||
.t-warn { fill: #8a5a08; font-size: 12px; font-weight: 600; }
|
||||
.t-mono { fill: #1b2430; font-size: 11.5px;
|
||||
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
|
||||
|
||||
.mid { text-anchor: middle; }
|
||||
.end { text-anchor: end; }
|
||||
|
||||
/* ---- interaction ====================================================
|
||||
* A .node groups one box with its labels. Hovering it lifts the whole group
|
||||
* a little, which is enough to follow a path through a busy diagram without
|
||||
* any script. Pointer events stay off the decorative layers so the hover
|
||||
* target is the shape itself.
|
||||
*/
|
||||
|
||||
.node { transition: opacity .12s ease; }
|
||||
.node:hover .box,
|
||||
.node:hover .box-accent,
|
||||
.node:hover .diamond { stroke-width: 2.6; }
|
||||
.node:hover .t, .node:hover .t-lead { fill: #20666f; }
|
||||
|
||||
svg:hover .node:not(:hover) { opacity: .55; }
|
||||
|
||||
/* a figure that marks no nodes must not dim on hover */
|
||||
svg:not(:has(.node)) .node { opacity: 1; }
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.node { transition: none; }
|
||||
}
|
||||
|
||||
/* ---- dark theme ------------------------------------------------------ */
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.box { fill: #1d2b33; stroke: #4c9aa5; }
|
||||
.box-weak { fill: #1d2b33; stroke: #4c9aa5; }
|
||||
.box-accent { fill: #24363d; stroke: #4c9aa5; }
|
||||
.box-warn { fill: #332a18; stroke: #c99a3a; }
|
||||
.box-plain { fill: #161b22; stroke: #30363d; }
|
||||
.diamond { fill: #24363d; stroke: #4c9aa5; }
|
||||
.ellipse { fill: #161b22; stroke: #8b98a8; }
|
||||
|
||||
.edge { stroke: #8b98a8; }
|
||||
.edge-strong{ stroke: #4c9aa5; }
|
||||
.edge-warn { stroke: #c99a3a; }
|
||||
.edge-dash { stroke: #8b98a8; }
|
||||
.rule { stroke: #30363d; }
|
||||
|
||||
.t, .t-sm, .t-lead, .t-key, .t-mono { fill: #e6edf3; }
|
||||
.t-mut { fill: #8b98a8; }
|
||||
.t-accent { fill: #4c9aa5; }
|
||||
.t-warn { fill: #c99a3a; }
|
||||
|
||||
.node:hover .t, .node:hover .t-lead { fill: #7fc4cf; }
|
||||
|
||||
.arrow { fill: #8b98a8; }
|
||||
.arrow-strong { fill: #4c9aa5; }
|
||||
.arrow-warn { fill: #c99a3a; }
|
||||
}
|
||||
|
||||
/* ---- arrowheads ======================================================
|
||||
* marker contents cannot inherit the referencing element's fill, so each
|
||||
* arrowhead is its own class and is themed alongside the line it ends.
|
||||
*/
|
||||
|
||||
.arrow { fill: #5a6879; }
|
||||
.arrow-strong { fill: #20666f; }
|
||||
.arrow-warn { fill: #8a5a08; }
|
||||
|
||||
]]></style>
|
||||
|
||||
<defs>
|
||||
<marker id="a" viewBox="0 0 10 10" refX="9" refY="5"
|
||||
markerWidth="6.5" markerHeight="6.5" orient="auto-start-reverse">
|
||||
<path class="arrow" d="M0,0 L10,5 L0,10 z"/>
|
||||
</marker>
|
||||
</defs>
|
||||
|
||||
<!-- everything happens inside one main(), on one thread -->
|
||||
<rect class="box-plain" x="14" y="16" width="732" height="126" rx="4"/>
|
||||
<text class="t-mut" data-label="frame" x="26" y="36">ein Prozess · ein Thread · ein main()</text>
|
||||
|
||||
<g class="node" data-flow-node="read">
|
||||
<rect class="box" x="40" y="58" width="170" height="52" rx="3"/>
|
||||
<text class="t-mono mid" data-label="read" x="125" y="90">IO.readln()</text>
|
||||
</g>
|
||||
|
||||
<path class="edge" data-flow="1" data-flow-to="rot" d="M210,84 H298" marker-end="url(#a)"/>
|
||||
<text class="t-accent mid" data-label="call1" x="254" y="72">Aufruf</text>
|
||||
|
||||
<g class="node" data-flow-node="rot">
|
||||
<rect class="box" x="300" y="58" width="170" height="52" rx="3"/>
|
||||
<text class="t-mono mid" data-label="rot" x="385" y="90">rot13(text)</text>
|
||||
</g>
|
||||
|
||||
<path class="edge" data-flow="2" data-flow-to="print" d="M470,84 H558" marker-end="url(#a)"/>
|
||||
<text class="t-accent mid" data-label="call2" x="514" y="72">Aufruf</text>
|
||||
|
||||
<g class="node" data-flow-node="print">
|
||||
<rect class="box" x="560" y="58" width="170" height="52" rx="3"/>
|
||||
<text class="t-mono mid" data-label="print" x="645" y="90">IO.println(…)</text>
|
||||
</g>
|
||||
|
||||
<!-- who knows whom -->
|
||||
<text class="t-sm" data-label="knows" x="14" y="176">main() kennt alle drei: ihre Namen, Argument- und Ergebnistypen und dass sie sofort verfügbar sind.</text>
|
||||
<text class="t-mut" data-label="cost" x="14" y="202">Die Verdrahtung steht im Code selbst — Schritt 1 des Tutorials.</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 6.5 KiB |
@@ -0,0 +1,156 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 760 230" width="760" height="230"
|
||||
role="img" aria-labelledby="dc-title">
|
||||
<title id="dc-title">The procedural version: inside one main(), IO.readln() is called, its result is passed to rot13(), and that result is passed to IO.println(). One thread, one process, three direct calls.</title>
|
||||
<style><![CDATA[
|
||||
/* figures/diagram.css -- shared look of every built figure.
|
||||
*
|
||||
* build-figures.py drops this file into the style element of every built
|
||||
* svg, so a figure carries its own styling and stays self-contained.
|
||||
* Classes, not per-element fills, do the work: one edit here restyles the
|
||||
* whole book.
|
||||
*
|
||||
* The palette is theme.scss's: teal #20666f for structure, amber #8a5a08 for
|
||||
* the warning accent, ink #1b2430 for text, IBM Plex to match the page.
|
||||
*
|
||||
* Dark theme: the @media block follows the reader's system setting. librsvg
|
||||
* ignores media queries when it makes the pdf, so print always gets the light
|
||||
* theme -- which is what a printed page wants.
|
||||
*/
|
||||
|
||||
svg {
|
||||
font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
|
||||
/* the figure sits on the page, not on a white card of its own */
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
/* ---- surfaces ------------------------------------------------------- */
|
||||
|
||||
.box { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
||||
.box-weak { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
||||
.box-accent { fill: #e5eff1; stroke: #20666f; stroke-width: 1.8; }
|
||||
.box-warn { fill: #f8f1e0; stroke: #8a5a08; stroke-width: 1.4; }
|
||||
.box-plain { fill: #fbfcfd; stroke: #dae0e8; stroke-width: 1.2; }
|
||||
.diamond { fill: #e5eff1; stroke: #20666f; stroke-width: 1.4; }
|
||||
.ellipse { fill: #fbfcfd; stroke: #5a6879; stroke-width: 1.2; }
|
||||
|
||||
/* ---- lines ---------------------------------------------------------- */
|
||||
|
||||
.edge { fill: none; stroke: #5a6879; stroke-width: 1.3; }
|
||||
.edge-strong{ fill: none; stroke: #20666f; stroke-width: 1.8; }
|
||||
.edge-warn { fill: none; stroke: #8a5a08; stroke-width: 1.6; }
|
||||
.edge-dash { fill: none; stroke: #5a6879; stroke-width: 1.2; stroke-dasharray: 5 3; }
|
||||
.rule { stroke: #dae0e8; stroke-width: 1; }
|
||||
|
||||
/* ---- text ----------------------------------------------------------- */
|
||||
|
||||
.t { fill: #1b2430; font-size: 13px; }
|
||||
.t-sm { fill: #1b2430; font-size: 11px; }
|
||||
.t-lead { fill: #1b2430; font-size: 14px; font-weight: 600; }
|
||||
.t-mut { fill: #5a6879; font-size: 11px; }
|
||||
.t-key { fill: #1b2430; font-size: 12px; text-decoration: underline; }
|
||||
.t-accent { fill: #20666f; font-size: 12px; font-weight: 600; }
|
||||
.t-warn { fill: #8a5a08; font-size: 12px; font-weight: 600; }
|
||||
.t-mono { fill: #1b2430; font-size: 11.5px;
|
||||
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
|
||||
|
||||
.mid { text-anchor: middle; }
|
||||
.end { text-anchor: end; }
|
||||
|
||||
/* ---- interaction ====================================================
|
||||
* A .node groups one box with its labels. Hovering it lifts the whole group
|
||||
* a little, which is enough to follow a path through a busy diagram without
|
||||
* any script. Pointer events stay off the decorative layers so the hover
|
||||
* target is the shape itself.
|
||||
*/
|
||||
|
||||
.node { transition: opacity .12s ease; }
|
||||
.node:hover .box,
|
||||
.node:hover .box-accent,
|
||||
.node:hover .diamond { stroke-width: 2.6; }
|
||||
.node:hover .t, .node:hover .t-lead { fill: #20666f; }
|
||||
|
||||
svg:hover .node:not(:hover) { opacity: .55; }
|
||||
|
||||
/* a figure that marks no nodes must not dim on hover */
|
||||
svg:not(:has(.node)) .node { opacity: 1; }
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.node { transition: none; }
|
||||
}
|
||||
|
||||
/* ---- dark theme ------------------------------------------------------ */
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.box { fill: #1d2b33; stroke: #4c9aa5; }
|
||||
.box-weak { fill: #1d2b33; stroke: #4c9aa5; }
|
||||
.box-accent { fill: #24363d; stroke: #4c9aa5; }
|
||||
.box-warn { fill: #332a18; stroke: #c99a3a; }
|
||||
.box-plain { fill: #161b22; stroke: #30363d; }
|
||||
.diamond { fill: #24363d; stroke: #4c9aa5; }
|
||||
.ellipse { fill: #161b22; stroke: #8b98a8; }
|
||||
|
||||
.edge { stroke: #8b98a8; }
|
||||
.edge-strong{ stroke: #4c9aa5; }
|
||||
.edge-warn { stroke: #c99a3a; }
|
||||
.edge-dash { stroke: #8b98a8; }
|
||||
.rule { stroke: #30363d; }
|
||||
|
||||
.t, .t-sm, .t-lead, .t-key, .t-mono { fill: #e6edf3; }
|
||||
.t-mut { fill: #8b98a8; }
|
||||
.t-accent { fill: #4c9aa5; }
|
||||
.t-warn { fill: #c99a3a; }
|
||||
|
||||
.node:hover .t, .node:hover .t-lead { fill: #7fc4cf; }
|
||||
|
||||
.arrow { fill: #8b98a8; }
|
||||
.arrow-strong { fill: #4c9aa5; }
|
||||
.arrow-warn { fill: #c99a3a; }
|
||||
}
|
||||
|
||||
/* ---- arrowheads ======================================================
|
||||
* marker contents cannot inherit the referencing element's fill, so each
|
||||
* arrowhead is its own class and is themed alongside the line it ends.
|
||||
*/
|
||||
|
||||
.arrow { fill: #5a6879; }
|
||||
.arrow-strong { fill: #20666f; }
|
||||
.arrow-warn { fill: #8a5a08; }
|
||||
|
||||
]]></style>
|
||||
|
||||
<defs>
|
||||
<marker id="a" viewBox="0 0 10 10" refX="9" refY="5"
|
||||
markerWidth="6.5" markerHeight="6.5" orient="auto-start-reverse">
|
||||
<path class="arrow" d="M0,0 L10,5 L0,10 z"/>
|
||||
</marker>
|
||||
</defs>
|
||||
|
||||
<!-- everything happens inside one main(), on one thread -->
|
||||
<rect class="box-plain" x="14" y="16" width="732" height="126" rx="4"/>
|
||||
<text class="t-mut" data-label="frame" x="26" y="36">one process · one thread · one main()</text>
|
||||
|
||||
<g class="node" data-flow-node="read">
|
||||
<rect class="box" x="40" y="58" width="170" height="52" rx="3"/>
|
||||
<text class="t-mono mid" data-label="read" x="125" y="90">IO.readln()</text>
|
||||
</g>
|
||||
|
||||
<path class="edge" data-flow="1" data-flow-to="rot" d="M210,84 H298" marker-end="url(#a)"/>
|
||||
<text class="t-accent mid" data-label="call1" x="254" y="72">call</text>
|
||||
|
||||
<g class="node" data-flow-node="rot">
|
||||
<rect class="box" x="300" y="58" width="170" height="52" rx="3"/>
|
||||
<text class="t-mono mid" data-label="rot" x="385" y="90">rot13(text)</text>
|
||||
</g>
|
||||
|
||||
<path class="edge" data-flow="2" data-flow-to="print" d="M470,84 H558" marker-end="url(#a)"/>
|
||||
<text class="t-accent mid" data-label="call2" x="514" y="72">call</text>
|
||||
|
||||
<g class="node" data-flow-node="print">
|
||||
<rect class="box" x="560" y="58" width="170" height="52" rx="3"/>
|
||||
<text class="t-mono mid" data-label="print" x="645" y="90">IO.println(…)</text>
|
||||
</g>
|
||||
|
||||
<!-- who knows whom -->
|
||||
<text class="t-sm" data-label="knows" x="14" y="176">main() knows all three: their names, argument and result types, and that they are available right now.</text>
|
||||
<text class="t-mut" data-label="cost" x="14" y="202">The wiring is written into the code itself — step 1 of the tutorial.</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 6.5 KiB |
@@ -0,0 +1,156 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 760 230" width="760" height="230"
|
||||
role="img" aria-labelledby="dc-title">
|
||||
<title id="dc-title">La version procédurale : dans un seul main(), IO.readln() est appelé, son résultat est passé à rot13(), et ce résultat est passé à IO.println(). Un seul fil d'exécution, un seul processus, trois appels directs.</title>
|
||||
<style><![CDATA[
|
||||
/* figures/diagram.css -- shared look of every built figure.
|
||||
*
|
||||
* build-figures.py drops this file into the style element of every built
|
||||
* svg, so a figure carries its own styling and stays self-contained.
|
||||
* Classes, not per-element fills, do the work: one edit here restyles the
|
||||
* whole book.
|
||||
*
|
||||
* The palette is theme.scss's: teal #20666f for structure, amber #8a5a08 for
|
||||
* the warning accent, ink #1b2430 for text, IBM Plex to match the page.
|
||||
*
|
||||
* Dark theme: the @media block follows the reader's system setting. librsvg
|
||||
* ignores media queries when it makes the pdf, so print always gets the light
|
||||
* theme -- which is what a printed page wants.
|
||||
*/
|
||||
|
||||
svg {
|
||||
font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
|
||||
/* the figure sits on the page, not on a white card of its own */
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
/* ---- surfaces ------------------------------------------------------- */
|
||||
|
||||
.box { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
||||
.box-weak { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
||||
.box-accent { fill: #e5eff1; stroke: #20666f; stroke-width: 1.8; }
|
||||
.box-warn { fill: #f8f1e0; stroke: #8a5a08; stroke-width: 1.4; }
|
||||
.box-plain { fill: #fbfcfd; stroke: #dae0e8; stroke-width: 1.2; }
|
||||
.diamond { fill: #e5eff1; stroke: #20666f; stroke-width: 1.4; }
|
||||
.ellipse { fill: #fbfcfd; stroke: #5a6879; stroke-width: 1.2; }
|
||||
|
||||
/* ---- lines ---------------------------------------------------------- */
|
||||
|
||||
.edge { fill: none; stroke: #5a6879; stroke-width: 1.3; }
|
||||
.edge-strong{ fill: none; stroke: #20666f; stroke-width: 1.8; }
|
||||
.edge-warn { fill: none; stroke: #8a5a08; stroke-width: 1.6; }
|
||||
.edge-dash { fill: none; stroke: #5a6879; stroke-width: 1.2; stroke-dasharray: 5 3; }
|
||||
.rule { stroke: #dae0e8; stroke-width: 1; }
|
||||
|
||||
/* ---- text ----------------------------------------------------------- */
|
||||
|
||||
.t { fill: #1b2430; font-size: 13px; }
|
||||
.t-sm { fill: #1b2430; font-size: 11px; }
|
||||
.t-lead { fill: #1b2430; font-size: 14px; font-weight: 600; }
|
||||
.t-mut { fill: #5a6879; font-size: 11px; }
|
||||
.t-key { fill: #1b2430; font-size: 12px; text-decoration: underline; }
|
||||
.t-accent { fill: #20666f; font-size: 12px; font-weight: 600; }
|
||||
.t-warn { fill: #8a5a08; font-size: 12px; font-weight: 600; }
|
||||
.t-mono { fill: #1b2430; font-size: 11.5px;
|
||||
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
|
||||
|
||||
.mid { text-anchor: middle; }
|
||||
.end { text-anchor: end; }
|
||||
|
||||
/* ---- interaction ====================================================
|
||||
* A .node groups one box with its labels. Hovering it lifts the whole group
|
||||
* a little, which is enough to follow a path through a busy diagram without
|
||||
* any script. Pointer events stay off the decorative layers so the hover
|
||||
* target is the shape itself.
|
||||
*/
|
||||
|
||||
.node { transition: opacity .12s ease; }
|
||||
.node:hover .box,
|
||||
.node:hover .box-accent,
|
||||
.node:hover .diamond { stroke-width: 2.6; }
|
||||
.node:hover .t, .node:hover .t-lead { fill: #20666f; }
|
||||
|
||||
svg:hover .node:not(:hover) { opacity: .55; }
|
||||
|
||||
/* a figure that marks no nodes must not dim on hover */
|
||||
svg:not(:has(.node)) .node { opacity: 1; }
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.node { transition: none; }
|
||||
}
|
||||
|
||||
/* ---- dark theme ------------------------------------------------------ */
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.box { fill: #1d2b33; stroke: #4c9aa5; }
|
||||
.box-weak { fill: #1d2b33; stroke: #4c9aa5; }
|
||||
.box-accent { fill: #24363d; stroke: #4c9aa5; }
|
||||
.box-warn { fill: #332a18; stroke: #c99a3a; }
|
||||
.box-plain { fill: #161b22; stroke: #30363d; }
|
||||
.diamond { fill: #24363d; stroke: #4c9aa5; }
|
||||
.ellipse { fill: #161b22; stroke: #8b98a8; }
|
||||
|
||||
.edge { stroke: #8b98a8; }
|
||||
.edge-strong{ stroke: #4c9aa5; }
|
||||
.edge-warn { stroke: #c99a3a; }
|
||||
.edge-dash { stroke: #8b98a8; }
|
||||
.rule { stroke: #30363d; }
|
||||
|
||||
.t, .t-sm, .t-lead, .t-key, .t-mono { fill: #e6edf3; }
|
||||
.t-mut { fill: #8b98a8; }
|
||||
.t-accent { fill: #4c9aa5; }
|
||||
.t-warn { fill: #c99a3a; }
|
||||
|
||||
.node:hover .t, .node:hover .t-lead { fill: #7fc4cf; }
|
||||
|
||||
.arrow { fill: #8b98a8; }
|
||||
.arrow-strong { fill: #4c9aa5; }
|
||||
.arrow-warn { fill: #c99a3a; }
|
||||
}
|
||||
|
||||
/* ---- arrowheads ======================================================
|
||||
* marker contents cannot inherit the referencing element's fill, so each
|
||||
* arrowhead is its own class and is themed alongside the line it ends.
|
||||
*/
|
||||
|
||||
.arrow { fill: #5a6879; }
|
||||
.arrow-strong { fill: #20666f; }
|
||||
.arrow-warn { fill: #8a5a08; }
|
||||
|
||||
]]></style>
|
||||
|
||||
<defs>
|
||||
<marker id="a" viewBox="0 0 10 10" refX="9" refY="5"
|
||||
markerWidth="6.5" markerHeight="6.5" orient="auto-start-reverse">
|
||||
<path class="arrow" d="M0,0 L10,5 L0,10 z"/>
|
||||
</marker>
|
||||
</defs>
|
||||
|
||||
<!-- everything happens inside one main(), on one thread -->
|
||||
<rect class="box-plain" x="14" y="16" width="732" height="126" rx="4"/>
|
||||
<text class="t-mut" data-label="frame" x="26" y="36">un processus · un fil · un seul main()</text>
|
||||
|
||||
<g class="node" data-flow-node="read">
|
||||
<rect class="box" x="40" y="58" width="170" height="52" rx="3"/>
|
||||
<text class="t-mono mid" data-label="read" x="125" y="90">IO.readln()</text>
|
||||
</g>
|
||||
|
||||
<path class="edge" data-flow="1" data-flow-to="rot" d="M210,84 H298" marker-end="url(#a)"/>
|
||||
<text class="t-accent mid" data-label="call1" x="254" y="72">appel</text>
|
||||
|
||||
<g class="node" data-flow-node="rot">
|
||||
<rect class="box" x="300" y="58" width="170" height="52" rx="3"/>
|
||||
<text class="t-mono mid" data-label="rot" x="385" y="90">rot13(text)</text>
|
||||
</g>
|
||||
|
||||
<path class="edge" data-flow="2" data-flow-to="print" d="M470,84 H558" marker-end="url(#a)"/>
|
||||
<text class="t-accent mid" data-label="call2" x="514" y="72">appel</text>
|
||||
|
||||
<g class="node" data-flow-node="print">
|
||||
<rect class="box" x="560" y="58" width="170" height="52" rx="3"/>
|
||||
<text class="t-mono mid" data-label="print" x="645" y="90">IO.println(…)</text>
|
||||
</g>
|
||||
|
||||
<!-- 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>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 6.6 KiB |
@@ -0,0 +1,213 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 620 700" width="620" height="700"
|
||||
role="img" aria-labelledby="fp-title">
|
||||
<title id="fp-title">Dieselbe Kette als fünf getrennte Prozesse auf einem Rechner: SensorService veröffentlicht eine .msg-Datei in consoleIn/outbox, ein Mediator-Prozess beobachtet dieses Verzeichnis und veröffentlicht eine Kopie in rot13/inbox, ProcessorService veröffentlicht sein Ergebnis in rot13/outbox, ein zweiter Mediator-Prozess verschiebt es nach consoleOut/inbox, und ActuatorService gibt es aus. Die vier Verzeichnisse bilden das Nachrichtenbrett auf einem lokalen Dateisystem.</title>
|
||||
<style><![CDATA[
|
||||
/* figures/diagram.css -- shared look of every built figure.
|
||||
*
|
||||
* build-figures.py drops this file into the style element of every built
|
||||
* svg, so a figure carries its own styling and stays self-contained.
|
||||
* Classes, not per-element fills, do the work: one edit here restyles the
|
||||
* whole book.
|
||||
*
|
||||
* The palette is theme.scss's: teal #20666f for structure, amber #8a5a08 for
|
||||
* the warning accent, ink #1b2430 for text, IBM Plex to match the page.
|
||||
*
|
||||
* Dark theme: the @media block follows the reader's system setting. librsvg
|
||||
* ignores media queries when it makes the pdf, so print always gets the light
|
||||
* theme -- which is what a printed page wants.
|
||||
*/
|
||||
|
||||
svg {
|
||||
font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
|
||||
/* the figure sits on the page, not on a white card of its own */
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
/* ---- surfaces ------------------------------------------------------- */
|
||||
|
||||
.box { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
||||
.box-weak { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
||||
.box-accent { fill: #e5eff1; stroke: #20666f; stroke-width: 1.8; }
|
||||
.box-warn { fill: #f8f1e0; stroke: #8a5a08; stroke-width: 1.4; }
|
||||
.box-plain { fill: #fbfcfd; stroke: #dae0e8; stroke-width: 1.2; }
|
||||
.diamond { fill: #e5eff1; stroke: #20666f; stroke-width: 1.4; }
|
||||
.ellipse { fill: #fbfcfd; stroke: #5a6879; stroke-width: 1.2; }
|
||||
|
||||
/* ---- lines ---------------------------------------------------------- */
|
||||
|
||||
.edge { fill: none; stroke: #5a6879; stroke-width: 1.3; }
|
||||
.edge-strong{ fill: none; stroke: #20666f; stroke-width: 1.8; }
|
||||
.edge-warn { fill: none; stroke: #8a5a08; stroke-width: 1.6; }
|
||||
.edge-dash { fill: none; stroke: #5a6879; stroke-width: 1.2; stroke-dasharray: 5 3; }
|
||||
.rule { stroke: #dae0e8; stroke-width: 1; }
|
||||
|
||||
/* ---- text ----------------------------------------------------------- */
|
||||
|
||||
.t { fill: #1b2430; font-size: 13px; }
|
||||
.t-sm { fill: #1b2430; font-size: 11px; }
|
||||
.t-lead { fill: #1b2430; font-size: 14px; font-weight: 600; }
|
||||
.t-mut { fill: #5a6879; font-size: 11px; }
|
||||
.t-key { fill: #1b2430; font-size: 12px; text-decoration: underline; }
|
||||
.t-accent { fill: #20666f; font-size: 12px; font-weight: 600; }
|
||||
.t-warn { fill: #8a5a08; font-size: 12px; font-weight: 600; }
|
||||
.t-mono { fill: #1b2430; font-size: 11.5px;
|
||||
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
|
||||
|
||||
.mid { text-anchor: middle; }
|
||||
.end { text-anchor: end; }
|
||||
|
||||
/* ---- interaction ====================================================
|
||||
* A .node groups one box with its labels. Hovering it lifts the whole group
|
||||
* a little, which is enough to follow a path through a busy diagram without
|
||||
* any script. Pointer events stay off the decorative layers so the hover
|
||||
* target is the shape itself.
|
||||
*/
|
||||
|
||||
.node { transition: opacity .12s ease; }
|
||||
.node:hover .box,
|
||||
.node:hover .box-accent,
|
||||
.node:hover .diamond { stroke-width: 2.6; }
|
||||
.node:hover .t, .node:hover .t-lead { fill: #20666f; }
|
||||
|
||||
svg:hover .node:not(:hover) { opacity: .55; }
|
||||
|
||||
/* a figure that marks no nodes must not dim on hover */
|
||||
svg:not(:has(.node)) .node { opacity: 1; }
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.node { transition: none; }
|
||||
}
|
||||
|
||||
/* ---- dark theme ------------------------------------------------------ */
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.box { fill: #1d2b33; stroke: #4c9aa5; }
|
||||
.box-weak { fill: #1d2b33; stroke: #4c9aa5; }
|
||||
.box-accent { fill: #24363d; stroke: #4c9aa5; }
|
||||
.box-warn { fill: #332a18; stroke: #c99a3a; }
|
||||
.box-plain { fill: #161b22; stroke: #30363d; }
|
||||
.diamond { fill: #24363d; stroke: #4c9aa5; }
|
||||
.ellipse { fill: #161b22; stroke: #8b98a8; }
|
||||
|
||||
.edge { stroke: #8b98a8; }
|
||||
.edge-strong{ stroke: #4c9aa5; }
|
||||
.edge-warn { stroke: #c99a3a; }
|
||||
.edge-dash { stroke: #8b98a8; }
|
||||
.rule { stroke: #30363d; }
|
||||
|
||||
.t, .t-sm, .t-lead, .t-key, .t-mono { fill: #e6edf3; }
|
||||
.t-mut { fill: #8b98a8; }
|
||||
.t-accent { fill: #4c9aa5; }
|
||||
.t-warn { fill: #c99a3a; }
|
||||
|
||||
.node:hover .t, .node:hover .t-lead { fill: #7fc4cf; }
|
||||
|
||||
.arrow { fill: #8b98a8; }
|
||||
.arrow-strong { fill: #4c9aa5; }
|
||||
.arrow-warn { fill: #c99a3a; }
|
||||
}
|
||||
|
||||
/* ---- arrowheads ======================================================
|
||||
* marker contents cannot inherit the referencing element's fill, so each
|
||||
* arrowhead is its own class and is themed alongside the line it ends.
|
||||
*/
|
||||
|
||||
.arrow { fill: #5a6879; }
|
||||
.arrow-strong { fill: #20666f; }
|
||||
.arrow-warn { fill: #8a5a08; }
|
||||
|
||||
]]>
|
||||
[data-label="mediator1"] { font-size: 11px; }
|
||||
[data-label="mediator2"] { font-size: 11px; }</style>
|
||||
|
||||
<defs>
|
||||
<marker id="a" viewBox="0 0 10 10" refX="9" refY="5"
|
||||
markerWidth="6.5" markerHeight="6.5" orient="auto-start-reverse">
|
||||
<path class="arrow" d="M0,0 L10,5 L0,10 z"/>
|
||||
</marker>
|
||||
</defs>
|
||||
|
||||
<!-- 1. SensorService (terminal 1) ==================================== -->
|
||||
<g class="node" data-flow-node="sensor">
|
||||
<rect class="box" x="120" y="24" width="300" height="46" rx="3"/>
|
||||
<text class="t-lead mid" data-label="sensor" x="270" y="46">SensorService — ConsoleIn</text>
|
||||
<text class="t-mut mid" data-label="t1" x="270" y="62">Terminal 1</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="1" data-flow-to="outbox1" d="M270,70 V96" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="publish1" x="286" y="88">veröffentlichen (.tmp → .msg)</text>
|
||||
|
||||
<!-- 2. consoleIn/outbox ============================================= -->
|
||||
<g class="node" data-flow-node="outbox1">
|
||||
<rect class="box-plain" x="120" y="98" width="300" height="44" rx="3"/>
|
||||
<text class="t-mono mid" x="270" y="126">consoleIn/outbox/*.msg</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="2" data-flow-to="mediator1" d="M270,142 V168" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="watch1" x="286" y="160">WatchService</text>
|
||||
|
||||
<!-- 3. first mediator process (terminal 2) =========================== -->
|
||||
<g class="node" data-flow-node="mediator1">
|
||||
<rect class="box-accent" x="120" y="170" width="300" height="46" rx="3"/>
|
||||
<text class="t-lead mid" data-label="mediator1" x="270" y="192">Mediator.java consoleIn/outbox rot13/inbox</text>
|
||||
<text class="t-mut mid" data-label="t2" x="270" y="208">Terminal 2</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="3" data-flow-to="inbox2" d="M270,216 V242" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="publish2" x="286" y="234">veröffentlichen</text>
|
||||
|
||||
<!-- 4. rot13/inbox =================================================== -->
|
||||
<g class="node" data-flow-node="inbox2">
|
||||
<rect class="box-plain" x="120" y="244" width="300" height="44" rx="3"/>
|
||||
<text class="t-mono mid" x="270" y="272">rot13/inbox/*.msg</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="4" data-flow-to="processor" d="M270,288 V314" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="watch2" x="286" y="306">WatchService</text>
|
||||
|
||||
<!-- 5. ProcessorService (terminal 3) ================================= -->
|
||||
<g class="node" data-flow-node="processor">
|
||||
<rect class="box" x="120" y="316" width="300" height="46" rx="3"/>
|
||||
<text class="t-lead mid" data-label="processor" x="270" y="338">ProcessorService — ROT13</text>
|
||||
<text class="t-mut mid" data-label="t3" x="270" y="354">Terminal 3</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="5" data-flow-to="outbox2" d="M270,362 V388" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="publish3" x="286" y="380">veröffentlichen</text>
|
||||
|
||||
<!-- 6. rot13/outbox ================================================== -->
|
||||
<g class="node" data-flow-node="outbox2">
|
||||
<rect class="box-plain" x="120" y="390" width="300" height="44" rx="3"/>
|
||||
<text class="t-mono mid" x="270" y="418">rot13/outbox/*.msg</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="6" data-flow-to="mediator2" d="M270,434 V460" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="watch3" x="286" y="452">WatchService</text>
|
||||
|
||||
<!-- 7. second mediator process (terminal 4) ========================== -->
|
||||
<g class="node" data-flow-node="mediator2">
|
||||
<rect class="box-accent" x="120" y="462" width="300" height="46" rx="3"/>
|
||||
<text class="t-lead mid" data-label="mediator2" x="270" y="484">Mediator.java rot13/outbox consoleOut/inbox</text>
|
||||
<text class="t-mut mid" data-label="t4" x="270" y="500">Terminal 4</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="7" data-flow-to="inbox3" d="M270,508 V534" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="publish4" x="286" y="526">veröffentlichen</text>
|
||||
|
||||
<!-- 8. consoleOut/inbox ============================================== -->
|
||||
<g class="node" data-flow-node="inbox3">
|
||||
<rect class="box-plain" x="120" y="536" width="300" height="44" rx="3"/>
|
||||
<text class="t-mono mid" x="270" y="564">consoleOut/inbox/*.msg</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="8" data-flow-to="actuator" d="M270,580 V606" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="watch4" x="286" y="598">WatchService</text>
|
||||
|
||||
<!-- 9. ActuatorService (terminal 5) ================================== -->
|
||||
<g class="node" data-flow-node="actuator">
|
||||
<rect class="box" x="120" y="608" width="300" height="46" rx="3"/>
|
||||
<text class="t-lead mid" data-label="actuator" x="270" y="630">ActuatorService — ConsoleOut</text>
|
||||
<text class="t-mut mid" data-label="t5" x="270" y="646">Terminal 5</text>
|
||||
</g>
|
||||
|
||||
<!-- the four directories belong to one message board on one filesystem -->
|
||||
<path class="edge-dash" d="M436,98 H452 V580 H436"/>
|
||||
<text class="t-mono" x="460" y="330">messageBoard/</text>
|
||||
<text class="t-mut" data-label="board" x="460" y="348">Verzeichnis = Postfach, Datei = Nachricht</text>
|
||||
|
||||
<!-- the five processes are started by hand, one terminal each -->
|
||||
<path class="edge-dash" d="M104,24 H88 V654 H104"/>
|
||||
<text class="t-warn" data-label="topology" x="14" y="686">Fünf von Hand gestartete Prozesse. Die Topologie steckt nun in den zwei Mediator-Befehlszeilen — bei dem, der sie getippt hat.</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 10 KiB |
@@ -0,0 +1,211 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 620 700" width="620" height="700"
|
||||
role="img" aria-labelledby="fp-title">
|
||||
<title id="fp-title">The same chain as five separate processes on one computer: SensorService publishes a .msg file into consoleIn/outbox, a Mediator process watches that directory and publishes a copy into rot13/inbox, ProcessorService publishes its result into rot13/outbox, a second Mediator process moves it into consoleOut/inbox, and ActuatorService prints it. The four directories form the message board on one local filesystem.</title>
|
||||
<style><![CDATA[
|
||||
/* figures/diagram.css -- shared look of every built figure.
|
||||
*
|
||||
* build-figures.py drops this file into the style element of every built
|
||||
* svg, so a figure carries its own styling and stays self-contained.
|
||||
* Classes, not per-element fills, do the work: one edit here restyles the
|
||||
* whole book.
|
||||
*
|
||||
* The palette is theme.scss's: teal #20666f for structure, amber #8a5a08 for
|
||||
* the warning accent, ink #1b2430 for text, IBM Plex to match the page.
|
||||
*
|
||||
* Dark theme: the @media block follows the reader's system setting. librsvg
|
||||
* ignores media queries when it makes the pdf, so print always gets the light
|
||||
* theme -- which is what a printed page wants.
|
||||
*/
|
||||
|
||||
svg {
|
||||
font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
|
||||
/* the figure sits on the page, not on a white card of its own */
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
/* ---- surfaces ------------------------------------------------------- */
|
||||
|
||||
.box { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
||||
.box-weak { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
||||
.box-accent { fill: #e5eff1; stroke: #20666f; stroke-width: 1.8; }
|
||||
.box-warn { fill: #f8f1e0; stroke: #8a5a08; stroke-width: 1.4; }
|
||||
.box-plain { fill: #fbfcfd; stroke: #dae0e8; stroke-width: 1.2; }
|
||||
.diamond { fill: #e5eff1; stroke: #20666f; stroke-width: 1.4; }
|
||||
.ellipse { fill: #fbfcfd; stroke: #5a6879; stroke-width: 1.2; }
|
||||
|
||||
/* ---- lines ---------------------------------------------------------- */
|
||||
|
||||
.edge { fill: none; stroke: #5a6879; stroke-width: 1.3; }
|
||||
.edge-strong{ fill: none; stroke: #20666f; stroke-width: 1.8; }
|
||||
.edge-warn { fill: none; stroke: #8a5a08; stroke-width: 1.6; }
|
||||
.edge-dash { fill: none; stroke: #5a6879; stroke-width: 1.2; stroke-dasharray: 5 3; }
|
||||
.rule { stroke: #dae0e8; stroke-width: 1; }
|
||||
|
||||
/* ---- text ----------------------------------------------------------- */
|
||||
|
||||
.t { fill: #1b2430; font-size: 13px; }
|
||||
.t-sm { fill: #1b2430; font-size: 11px; }
|
||||
.t-lead { fill: #1b2430; font-size: 14px; font-weight: 600; }
|
||||
.t-mut { fill: #5a6879; font-size: 11px; }
|
||||
.t-key { fill: #1b2430; font-size: 12px; text-decoration: underline; }
|
||||
.t-accent { fill: #20666f; font-size: 12px; font-weight: 600; }
|
||||
.t-warn { fill: #8a5a08; font-size: 12px; font-weight: 600; }
|
||||
.t-mono { fill: #1b2430; font-size: 11.5px;
|
||||
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
|
||||
|
||||
.mid { text-anchor: middle; }
|
||||
.end { text-anchor: end; }
|
||||
|
||||
/* ---- interaction ====================================================
|
||||
* A .node groups one box with its labels. Hovering it lifts the whole group
|
||||
* a little, which is enough to follow a path through a busy diagram without
|
||||
* any script. Pointer events stay off the decorative layers so the hover
|
||||
* target is the shape itself.
|
||||
*/
|
||||
|
||||
.node { transition: opacity .12s ease; }
|
||||
.node:hover .box,
|
||||
.node:hover .box-accent,
|
||||
.node:hover .diamond { stroke-width: 2.6; }
|
||||
.node:hover .t, .node:hover .t-lead { fill: #20666f; }
|
||||
|
||||
svg:hover .node:not(:hover) { opacity: .55; }
|
||||
|
||||
/* a figure that marks no nodes must not dim on hover */
|
||||
svg:not(:has(.node)) .node { opacity: 1; }
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.node { transition: none; }
|
||||
}
|
||||
|
||||
/* ---- dark theme ------------------------------------------------------ */
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.box { fill: #1d2b33; stroke: #4c9aa5; }
|
||||
.box-weak { fill: #1d2b33; stroke: #4c9aa5; }
|
||||
.box-accent { fill: #24363d; stroke: #4c9aa5; }
|
||||
.box-warn { fill: #332a18; stroke: #c99a3a; }
|
||||
.box-plain { fill: #161b22; stroke: #30363d; }
|
||||
.diamond { fill: #24363d; stroke: #4c9aa5; }
|
||||
.ellipse { fill: #161b22; stroke: #8b98a8; }
|
||||
|
||||
.edge { stroke: #8b98a8; }
|
||||
.edge-strong{ stroke: #4c9aa5; }
|
||||
.edge-warn { stroke: #c99a3a; }
|
||||
.edge-dash { stroke: #8b98a8; }
|
||||
.rule { stroke: #30363d; }
|
||||
|
||||
.t, .t-sm, .t-lead, .t-key, .t-mono { fill: #e6edf3; }
|
||||
.t-mut { fill: #8b98a8; }
|
||||
.t-accent { fill: #4c9aa5; }
|
||||
.t-warn { fill: #c99a3a; }
|
||||
|
||||
.node:hover .t, .node:hover .t-lead { fill: #7fc4cf; }
|
||||
|
||||
.arrow { fill: #8b98a8; }
|
||||
.arrow-strong { fill: #4c9aa5; }
|
||||
.arrow-warn { fill: #c99a3a; }
|
||||
}
|
||||
|
||||
/* ---- arrowheads ======================================================
|
||||
* marker contents cannot inherit the referencing element's fill, so each
|
||||
* arrowhead is its own class and is themed alongside the line it ends.
|
||||
*/
|
||||
|
||||
.arrow { fill: #5a6879; }
|
||||
.arrow-strong { fill: #20666f; }
|
||||
.arrow-warn { fill: #8a5a08; }
|
||||
|
||||
]]></style>
|
||||
|
||||
<defs>
|
||||
<marker id="a" viewBox="0 0 10 10" refX="9" refY="5"
|
||||
markerWidth="6.5" markerHeight="6.5" orient="auto-start-reverse">
|
||||
<path class="arrow" d="M0,0 L10,5 L0,10 z"/>
|
||||
</marker>
|
||||
</defs>
|
||||
|
||||
<!-- 1. SensorService (terminal 1) ==================================== -->
|
||||
<g class="node" data-flow-node="sensor">
|
||||
<rect class="box" x="120" y="24" width="300" height="46" rx="3"/>
|
||||
<text class="t-lead mid" data-label="sensor" x="270" y="46">SensorService — ConsoleIn</text>
|
||||
<text class="t-mut mid" data-label="t1" x="270" y="62">terminal 1</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="1" data-flow-to="outbox1" d="M270,70 V96" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="publish1" x="286" y="88">publish (.tmp → .msg)</text>
|
||||
|
||||
<!-- 2. consoleIn/outbox ============================================= -->
|
||||
<g class="node" data-flow-node="outbox1">
|
||||
<rect class="box-plain" x="120" y="98" width="300" height="44" rx="3"/>
|
||||
<text class="t-mono mid" x="270" y="126">consoleIn/outbox/*.msg</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="2" data-flow-to="mediator1" d="M270,142 V168" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="watch1" x="286" y="160">WatchService</text>
|
||||
|
||||
<!-- 3. first mediator process (terminal 2) =========================== -->
|
||||
<g class="node" data-flow-node="mediator1">
|
||||
<rect class="box-accent" x="120" y="170" width="300" height="46" rx="3"/>
|
||||
<text class="t-lead mid" data-label="mediator1" x="270" y="192">Mediator.java consoleIn/outbox rot13/inbox</text>
|
||||
<text class="t-mut mid" data-label="t2" x="270" y="208">terminal 2</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="3" data-flow-to="inbox2" d="M270,216 V242" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="publish2" x="286" y="234">publish</text>
|
||||
|
||||
<!-- 4. rot13/inbox =================================================== -->
|
||||
<g class="node" data-flow-node="inbox2">
|
||||
<rect class="box-plain" x="120" y="244" width="300" height="44" rx="3"/>
|
||||
<text class="t-mono mid" x="270" y="272">rot13/inbox/*.msg</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="4" data-flow-to="processor" d="M270,288 V314" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="watch2" x="286" y="306">WatchService</text>
|
||||
|
||||
<!-- 5. ProcessorService (terminal 3) ================================= -->
|
||||
<g class="node" data-flow-node="processor">
|
||||
<rect class="box" x="120" y="316" width="300" height="46" rx="3"/>
|
||||
<text class="t-lead mid" data-label="processor" x="270" y="338">ProcessorService — ROT13</text>
|
||||
<text class="t-mut mid" data-label="t3" x="270" y="354">terminal 3</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="5" data-flow-to="outbox2" d="M270,362 V388" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="publish3" x="286" y="380">publish</text>
|
||||
|
||||
<!-- 6. rot13/outbox ================================================== -->
|
||||
<g class="node" data-flow-node="outbox2">
|
||||
<rect class="box-plain" x="120" y="390" width="300" height="44" rx="3"/>
|
||||
<text class="t-mono mid" x="270" y="418">rot13/outbox/*.msg</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="6" data-flow-to="mediator2" d="M270,434 V460" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="watch3" x="286" y="452">WatchService</text>
|
||||
|
||||
<!-- 7. second mediator process (terminal 4) ========================== -->
|
||||
<g class="node" data-flow-node="mediator2">
|
||||
<rect class="box-accent" x="120" y="462" width="300" height="46" rx="3"/>
|
||||
<text class="t-lead mid" data-label="mediator2" x="270" y="484">Mediator.java rot13/outbox consoleOut/inbox</text>
|
||||
<text class="t-mut mid" data-label="t4" x="270" y="500">terminal 4</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="7" data-flow-to="inbox3" d="M270,508 V534" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="publish4" x="286" y="526">publish</text>
|
||||
|
||||
<!-- 8. consoleOut/inbox ============================================== -->
|
||||
<g class="node" data-flow-node="inbox3">
|
||||
<rect class="box-plain" x="120" y="536" width="300" height="44" rx="3"/>
|
||||
<text class="t-mono mid" x="270" y="564">consoleOut/inbox/*.msg</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="8" data-flow-to="actuator" d="M270,580 V606" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="watch4" x="286" y="598">WatchService</text>
|
||||
|
||||
<!-- 9. ActuatorService (terminal 5) ================================== -->
|
||||
<g class="node" data-flow-node="actuator">
|
||||
<rect class="box" x="120" y="608" width="300" height="46" rx="3"/>
|
||||
<text class="t-lead mid" data-label="actuator" x="270" y="630">ActuatorService — ConsoleOut</text>
|
||||
<text class="t-mut mid" data-label="t5" x="270" y="646">terminal 5</text>
|
||||
</g>
|
||||
|
||||
<!-- the four directories belong to one message board on one filesystem -->
|
||||
<path class="edge-dash" d="M436,98 H452 V580 H436"/>
|
||||
<text class="t-mono" x="460" y="330">messageBoard/</text>
|
||||
<text class="t-mut" data-label="board" x="460" y="348">directory = mailbox, file = message</text>
|
||||
|
||||
<!-- the five processes are started by hand, one terminal each -->
|
||||
<path class="edge-dash" d="M104,24 H88 V654 H104"/>
|
||||
<text class="t-warn" data-label="topology" x="14" y="686">Five processes started by hand. The topology now lives in the two Mediator command lines — in whoever typed them.</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 10 KiB |
@@ -0,0 +1,211 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 620 700" width="620" height="700"
|
||||
role="img" aria-labelledby="fp-title">
|
||||
<title id="fp-title">La même chaîne sous forme de cinq processus distincts sur un seul ordinateur : SensorService publie un fichier .msg dans consoleIn/outbox, un processus Mediator surveille ce répertoire et publie une copie dans rot13/inbox, ProcessorService publie son résultat dans rot13/outbox, un second processus Mediator le déplace vers consoleOut/inbox, et ActuatorService l'affiche. Les quatre répertoires forment le tableau de messages sur un seul système de fichiers local.</title>
|
||||
<style><![CDATA[
|
||||
/* figures/diagram.css -- shared look of every built figure.
|
||||
*
|
||||
* build-figures.py drops this file into the style element of every built
|
||||
* svg, so a figure carries its own styling and stays self-contained.
|
||||
* Classes, not per-element fills, do the work: one edit here restyles the
|
||||
* whole book.
|
||||
*
|
||||
* The palette is theme.scss's: teal #20666f for structure, amber #8a5a08 for
|
||||
* the warning accent, ink #1b2430 for text, IBM Plex to match the page.
|
||||
*
|
||||
* Dark theme: the @media block follows the reader's system setting. librsvg
|
||||
* ignores media queries when it makes the pdf, so print always gets the light
|
||||
* theme -- which is what a printed page wants.
|
||||
*/
|
||||
|
||||
svg {
|
||||
font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
|
||||
/* the figure sits on the page, not on a white card of its own */
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
/* ---- surfaces ------------------------------------------------------- */
|
||||
|
||||
.box { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
||||
.box-weak { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
||||
.box-accent { fill: #e5eff1; stroke: #20666f; stroke-width: 1.8; }
|
||||
.box-warn { fill: #f8f1e0; stroke: #8a5a08; stroke-width: 1.4; }
|
||||
.box-plain { fill: #fbfcfd; stroke: #dae0e8; stroke-width: 1.2; }
|
||||
.diamond { fill: #e5eff1; stroke: #20666f; stroke-width: 1.4; }
|
||||
.ellipse { fill: #fbfcfd; stroke: #5a6879; stroke-width: 1.2; }
|
||||
|
||||
/* ---- lines ---------------------------------------------------------- */
|
||||
|
||||
.edge { fill: none; stroke: #5a6879; stroke-width: 1.3; }
|
||||
.edge-strong{ fill: none; stroke: #20666f; stroke-width: 1.8; }
|
||||
.edge-warn { fill: none; stroke: #8a5a08; stroke-width: 1.6; }
|
||||
.edge-dash { fill: none; stroke: #5a6879; stroke-width: 1.2; stroke-dasharray: 5 3; }
|
||||
.rule { stroke: #dae0e8; stroke-width: 1; }
|
||||
|
||||
/* ---- text ----------------------------------------------------------- */
|
||||
|
||||
.t { fill: #1b2430; font-size: 13px; }
|
||||
.t-sm { fill: #1b2430; font-size: 11px; }
|
||||
.t-lead { fill: #1b2430; font-size: 14px; font-weight: 600; }
|
||||
.t-mut { fill: #5a6879; font-size: 11px; }
|
||||
.t-key { fill: #1b2430; font-size: 12px; text-decoration: underline; }
|
||||
.t-accent { fill: #20666f; font-size: 12px; font-weight: 600; }
|
||||
.t-warn { fill: #8a5a08; font-size: 12px; font-weight: 600; }
|
||||
.t-mono { fill: #1b2430; font-size: 11.5px;
|
||||
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
|
||||
|
||||
.mid { text-anchor: middle; }
|
||||
.end { text-anchor: end; }
|
||||
|
||||
/* ---- interaction ====================================================
|
||||
* A .node groups one box with its labels. Hovering it lifts the whole group
|
||||
* a little, which is enough to follow a path through a busy diagram without
|
||||
* any script. Pointer events stay off the decorative layers so the hover
|
||||
* target is the shape itself.
|
||||
*/
|
||||
|
||||
.node { transition: opacity .12s ease; }
|
||||
.node:hover .box,
|
||||
.node:hover .box-accent,
|
||||
.node:hover .diamond { stroke-width: 2.6; }
|
||||
.node:hover .t, .node:hover .t-lead { fill: #20666f; }
|
||||
|
||||
svg:hover .node:not(:hover) { opacity: .55; }
|
||||
|
||||
/* a figure that marks no nodes must not dim on hover */
|
||||
svg:not(:has(.node)) .node { opacity: 1; }
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.node { transition: none; }
|
||||
}
|
||||
|
||||
/* ---- dark theme ------------------------------------------------------ */
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.box { fill: #1d2b33; stroke: #4c9aa5; }
|
||||
.box-weak { fill: #1d2b33; stroke: #4c9aa5; }
|
||||
.box-accent { fill: #24363d; stroke: #4c9aa5; }
|
||||
.box-warn { fill: #332a18; stroke: #c99a3a; }
|
||||
.box-plain { fill: #161b22; stroke: #30363d; }
|
||||
.diamond { fill: #24363d; stroke: #4c9aa5; }
|
||||
.ellipse { fill: #161b22; stroke: #8b98a8; }
|
||||
|
||||
.edge { stroke: #8b98a8; }
|
||||
.edge-strong{ stroke: #4c9aa5; }
|
||||
.edge-warn { stroke: #c99a3a; }
|
||||
.edge-dash { stroke: #8b98a8; }
|
||||
.rule { stroke: #30363d; }
|
||||
|
||||
.t, .t-sm, .t-lead, .t-key, .t-mono { fill: #e6edf3; }
|
||||
.t-mut { fill: #8b98a8; }
|
||||
.t-accent { fill: #4c9aa5; }
|
||||
.t-warn { fill: #c99a3a; }
|
||||
|
||||
.node:hover .t, .node:hover .t-lead { fill: #7fc4cf; }
|
||||
|
||||
.arrow { fill: #8b98a8; }
|
||||
.arrow-strong { fill: #4c9aa5; }
|
||||
.arrow-warn { fill: #c99a3a; }
|
||||
}
|
||||
|
||||
/* ---- arrowheads ======================================================
|
||||
* marker contents cannot inherit the referencing element's fill, so each
|
||||
* arrowhead is its own class and is themed alongside the line it ends.
|
||||
*/
|
||||
|
||||
.arrow { fill: #5a6879; }
|
||||
.arrow-strong { fill: #20666f; }
|
||||
.arrow-warn { fill: #8a5a08; }
|
||||
|
||||
]]></style>
|
||||
|
||||
<defs>
|
||||
<marker id="a" viewBox="0 0 10 10" refX="9" refY="5"
|
||||
markerWidth="6.5" markerHeight="6.5" orient="auto-start-reverse">
|
||||
<path class="arrow" d="M0,0 L10,5 L0,10 z"/>
|
||||
</marker>
|
||||
</defs>
|
||||
|
||||
<!-- 1. SensorService (terminal 1) ==================================== -->
|
||||
<g class="node" data-flow-node="sensor">
|
||||
<rect class="box" x="120" y="24" width="300" height="46" rx="3"/>
|
||||
<text class="t-lead mid" data-label="sensor" x="270" y="46">SensorService — ConsoleIn</text>
|
||||
<text class="t-mut mid" data-label="t1" x="270" y="62">terminal 1</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="1" data-flow-to="outbox1" d="M270,70 V96" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="publish1" x="286" y="88">publier (.tmp → .msg)</text>
|
||||
|
||||
<!-- 2. consoleIn/outbox ============================================= -->
|
||||
<g class="node" data-flow-node="outbox1">
|
||||
<rect class="box-plain" x="120" y="98" width="300" height="44" rx="3"/>
|
||||
<text class="t-mono mid" x="270" y="126">consoleIn/outbox/*.msg</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="2" data-flow-to="mediator1" d="M270,142 V168" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="watch1" x="286" y="160">WatchService</text>
|
||||
|
||||
<!-- 3. first mediator process (terminal 2) =========================== -->
|
||||
<g class="node" data-flow-node="mediator1">
|
||||
<rect class="box-accent" x="120" y="170" width="300" height="46" rx="3"/>
|
||||
<text class="t-lead mid" data-label="mediator1" x="270" y="192">Mediator.java consoleIn/outbox rot13/inbox</text>
|
||||
<text class="t-mut mid" data-label="t2" x="270" y="208">terminal 2</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="3" data-flow-to="inbox2" d="M270,216 V242" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="publish2" x="286" y="234">publier</text>
|
||||
|
||||
<!-- 4. rot13/inbox =================================================== -->
|
||||
<g class="node" data-flow-node="inbox2">
|
||||
<rect class="box-plain" x="120" y="244" width="300" height="44" rx="3"/>
|
||||
<text class="t-mono mid" x="270" y="272">rot13/inbox/*.msg</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="4" data-flow-to="processor" d="M270,288 V314" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="watch2" x="286" y="306">WatchService</text>
|
||||
|
||||
<!-- 5. ProcessorService (terminal 3) ================================= -->
|
||||
<g class="node" data-flow-node="processor">
|
||||
<rect class="box" x="120" y="316" width="300" height="46" rx="3"/>
|
||||
<text class="t-lead mid" data-label="processor" x="270" y="338">ProcessorService — ROT13</text>
|
||||
<text class="t-mut mid" data-label="t3" x="270" y="354">terminal 3</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="5" data-flow-to="outbox2" d="M270,362 V388" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="publish3" x="286" y="380">publier</text>
|
||||
|
||||
<!-- 6. rot13/outbox ================================================== -->
|
||||
<g class="node" data-flow-node="outbox2">
|
||||
<rect class="box-plain" x="120" y="390" width="300" height="44" rx="3"/>
|
||||
<text class="t-mono mid" x="270" y="418">rot13/outbox/*.msg</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="6" data-flow-to="mediator2" d="M270,434 V460" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="watch3" x="286" y="452">WatchService</text>
|
||||
|
||||
<!-- 7. second mediator process (terminal 4) ========================== -->
|
||||
<g class="node" data-flow-node="mediator2">
|
||||
<rect class="box-accent" x="120" y="462" width="300" height="46" rx="3"/>
|
||||
<text class="t-lead mid" data-label="mediator2" x="270" y="484">Mediator.java rot13/outbox consoleOut/inbox</text>
|
||||
<text class="t-mut mid" data-label="t4" x="270" y="500">terminal 4</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="7" data-flow-to="inbox3" d="M270,508 V534" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="publish4" x="286" y="526">publier</text>
|
||||
|
||||
<!-- 8. consoleOut/inbox ============================================== -->
|
||||
<g class="node" data-flow-node="inbox3">
|
||||
<rect class="box-plain" x="120" y="536" width="300" height="44" rx="3"/>
|
||||
<text class="t-mono mid" x="270" y="564">consoleOut/inbox/*.msg</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="8" data-flow-to="actuator" d="M270,580 V606" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="watch4" x="286" y="598">WatchService</text>
|
||||
|
||||
<!-- 9. ActuatorService (terminal 5) ================================== -->
|
||||
<g class="node" data-flow-node="actuator">
|
||||
<rect class="box" x="120" y="608" width="300" height="46" rx="3"/>
|
||||
<text class="t-lead mid" data-label="actuator" x="270" y="630">ActuatorService — ConsoleOut</text>
|
||||
<text class="t-mut mid" data-label="t5" x="270" y="646">terminal 5</text>
|
||||
</g>
|
||||
|
||||
<!-- the four directories belong to one message board on one filesystem -->
|
||||
<path class="edge-dash" d="M436,98 H452 V580 H436"/>
|
||||
<text class="t-mono" x="460" y="330">messageBoard/</text>
|
||||
<text class="t-mut" data-label="board" x="460" y="348">répertoire = boîte, fichier = message</text>
|
||||
|
||||
<!-- the five processes are started by hand, one terminal each -->
|
||||
<path class="edge-dash" d="M104,24 H88 V654 H104"/>
|
||||
<text class="t-warn" data-label="topology" x="14" y="686">Cinq processus lancés à la main. La topologie vit désormais dans les deux lignes de commande Mediator — chez celui qui les a tapées.</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 10 KiB |
@@ -0,0 +1,214 @@
|
||||
<!-- figures/flow-player.html -- the web version's interactive diagrams.
|
||||
Injected at the end of <body> by include-in-header's sibling
|
||||
include-after-body in _quarto.yml, so it is a no-op on a page that holds
|
||||
no img.flow-figure.
|
||||
|
||||
A chapter writes an ordinary Quarto figure and adds the class:
|
||||
|
||||
{#fig-x .flow-figure}
|
||||
|
||||
That keeps the PDF and the no-JavaScript case working: the built svg is
|
||||
already the whole picture. Here the image is fetched, inlined, and given
|
||||
a play bar that walks a message through the mailboxes, one hop per
|
||||
[data-flow] edge of the svg, highlighting the [data-flow-node] each hop
|
||||
ends at. Colours are diagram.css's, so the two stay in step. -->
|
||||
|
||||
<style>
|
||||
.flow-wrap { margin: 0; }
|
||||
.flow-wrap svg { width: 100%; height: auto; display: block; }
|
||||
|
||||
.flow-token { fill: #8a5a08; stroke: #fbfcfd; stroke-width: 1.2; }
|
||||
.flow-wrap .flow-on .box,
|
||||
.flow-wrap .flow-on .box-plain,
|
||||
.flow-wrap .flow-on .box-accent { stroke-width: 3; }
|
||||
.flow-wrap .flow-done { stroke: #8a5a08; }
|
||||
|
||||
.flow-bar {
|
||||
display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
|
||||
max-width: 100%; margin: .45rem 0 0;
|
||||
}
|
||||
.flow-bar button {
|
||||
font: inherit; font-size: .82rem; padding: .18rem .7rem; cursor: pointer;
|
||||
border: 1px solid #dae0e8; border-radius: 999px;
|
||||
background: #fbfcfd; color: #5a6879;
|
||||
}
|
||||
.flow-bar button:hover { border-color: #20666f; color: #20666f; }
|
||||
.flow-bar button[disabled] { opacity: .45; cursor: default; }
|
||||
.flow-status { font-size: .8rem; color: #5a6879; }
|
||||
.flow-status b { color: #20666f; font-weight: 600; }
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.flow-token { fill: #c99a3a; stroke: #161b22; }
|
||||
.flow-bar button { background: #161b22; border-color: #30363d; color: #8b98a8; }
|
||||
.flow-bar button:hover { border-color: #4c9aa5; color: #7fc4cf; }
|
||||
.flow-status { color: #8b98a8; }
|
||||
.flow-status b { color: #7fc4cf; }
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
(() => {
|
||||
const images = document.querySelectorAll("img.flow-figure");
|
||||
if (!images.length) return;
|
||||
|
||||
const LANG = (document.documentElement.lang || "en").slice(0, 2);
|
||||
const WORDS = {
|
||||
en: { play: "Play", pause: "Pause", step: "One hop", reset: "Reset",
|
||||
idle: "the message has not been sent yet", done: "arrived" },
|
||||
fr: { play: "Lancer", pause: "Pause", step: "Un saut", reset: "Réinitialiser",
|
||||
idle: "le message n'est pas encore parti", done: "arrivé" },
|
||||
de: { play: "Abspielen", pause: "Pause", step: "Ein Sprung", reset: "Zurücksetzen",
|
||||
idle: "die Nachricht ist noch nicht unterwegs", done: "angekommen" },
|
||||
};
|
||||
const W = WORDS[LANG] || WORDS.en;
|
||||
const STILL = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
||||
const HOP = 620; // ms per hop
|
||||
|
||||
const label = (node) => {
|
||||
const text = node && node.querySelector("text");
|
||||
return text ? text.textContent.trim() : "";
|
||||
};
|
||||
|
||||
async function upgrade(img) {
|
||||
let svg;
|
||||
try {
|
||||
const response = await fetch(img.currentSrc || img.src);
|
||||
if (!response.ok) return; // leave the plain image in place
|
||||
const doc = new DOMParser().parseFromString(await response.text(), "image/svg+xml");
|
||||
svg = doc.documentElement;
|
||||
if (!svg || svg.nodeName !== "svg" || doc.querySelector("parsererror")) return;
|
||||
} catch { return; } // file:// or offline: plain image
|
||||
|
||||
const edges = [...svg.querySelectorAll("[data-flow]")]
|
||||
.sort((a, b) => Number(a.dataset.flow) - Number(b.dataset.flow));
|
||||
if (!edges.length) return;
|
||||
|
||||
svg.removeAttribute("width");
|
||||
svg.removeAttribute("height");
|
||||
|
||||
const wrap = document.createElement("div");
|
||||
wrap.className = "flow-wrap";
|
||||
wrap.appendChild(svg);
|
||||
|
||||
const bar = document.createElement("div");
|
||||
bar.className = "flow-bar";
|
||||
const make = (name) => {
|
||||
const button = document.createElement("button");
|
||||
button.type = "button";
|
||||
button.textContent = W[name];
|
||||
bar.appendChild(button);
|
||||
return button;
|
||||
};
|
||||
const playButton = make("play");
|
||||
const stepButton = make("step");
|
||||
const resetButton = make("reset");
|
||||
const status = document.createElement("span");
|
||||
status.className = "flow-status";
|
||||
bar.appendChild(status);
|
||||
wrap.appendChild(bar);
|
||||
|
||||
img.hidden = true;
|
||||
img.after(wrap);
|
||||
|
||||
const token = document.createElementNS("http://www.w3.org/2000/svg", "circle");
|
||||
token.setAttribute("r", "6");
|
||||
token.setAttribute("class", "flow-token");
|
||||
token.style.display = "none";
|
||||
svg.appendChild(token);
|
||||
|
||||
let at = 0; // hops already made
|
||||
let playing = false;
|
||||
let frame = null;
|
||||
|
||||
const nodeOf = (edge) =>
|
||||
edge.dataset.flowTo
|
||||
? svg.querySelector(`[data-flow-node="${edge.dataset.flowTo}"]`)
|
||||
: null;
|
||||
|
||||
const say = () => {
|
||||
if (at === 0) { status.textContent = W.idle; return; }
|
||||
const here = label(nodeOf(edges[at - 1]));
|
||||
status.innerHTML = `${at} / ${edges.length} — <b></b>`;
|
||||
status.querySelector("b").textContent =
|
||||
at === edges.length ? `${here} (${W.done})` : here;
|
||||
};
|
||||
|
||||
const clear = () => {
|
||||
svg.querySelectorAll(".flow-on").forEach((n) => n.classList.remove("flow-on"));
|
||||
edges.forEach((e) => e.classList.remove("flow-done"));
|
||||
};
|
||||
|
||||
const place = (edge, fraction) => {
|
||||
const length = edge.getTotalLength();
|
||||
const point = edge.getPointAtLength(length * fraction);
|
||||
token.setAttribute("cx", point.x);
|
||||
token.setAttribute("cy", point.y);
|
||||
token.style.display = "";
|
||||
};
|
||||
|
||||
function hop(then) {
|
||||
const edge = edges[at];
|
||||
if (!edge) { then && then(false); return; }
|
||||
clear();
|
||||
const arrive = () => {
|
||||
edge.classList.add("flow-done");
|
||||
const node = nodeOf(edge);
|
||||
if (node) node.classList.add("flow-on");
|
||||
at += 1;
|
||||
say();
|
||||
buttons();
|
||||
then && then(at < edges.length);
|
||||
};
|
||||
if (STILL) { place(edge, 1); arrive(); return; }
|
||||
const start = performance.now();
|
||||
const tick = (now) => {
|
||||
const done = Math.min((now - start) / HOP, 1);
|
||||
place(edge, done);
|
||||
if (done < 1) { frame = requestAnimationFrame(tick); } else { frame = null; arrive(); }
|
||||
};
|
||||
frame = requestAnimationFrame(tick);
|
||||
}
|
||||
|
||||
function buttons() {
|
||||
const end = at >= edges.length;
|
||||
playButton.textContent = playing ? W.pause : W.play;
|
||||
playButton.disabled = end && !playing;
|
||||
stepButton.disabled = end || playing;
|
||||
resetButton.disabled = at === 0 && !playing;
|
||||
}
|
||||
|
||||
function stop() {
|
||||
playing = false;
|
||||
if (frame) { cancelAnimationFrame(frame); frame = null; }
|
||||
buttons();
|
||||
}
|
||||
|
||||
function run() {
|
||||
if (at >= edges.length) at = 0;
|
||||
playing = true;
|
||||
buttons();
|
||||
const next = (more) => {
|
||||
if (!playing) return;
|
||||
if (more) { hop(next); } else { stop(); }
|
||||
};
|
||||
hop(next);
|
||||
}
|
||||
|
||||
playButton.addEventListener("click", () => (playing ? stop() : run()));
|
||||
stepButton.addEventListener("click", () => { stop(); hop(); });
|
||||
resetButton.addEventListener("click", () => {
|
||||
stop();
|
||||
at = 0;
|
||||
clear();
|
||||
token.style.display = "none";
|
||||
say();
|
||||
buttons();
|
||||
});
|
||||
|
||||
say();
|
||||
buttons();
|
||||
}
|
||||
|
||||
images.forEach(upgrade);
|
||||
})();
|
||||
</script>
|
||||
@@ -0,0 +1,101 @@
|
||||
# figures/labels.yml -- every string that appears inside a figure.
|
||||
#
|
||||
# Keyed by the file name in figures/src/, then by the {{placeholder}} used
|
||||
# there. build-figures.py substitutes these and writes one svg + pdf per
|
||||
# language. The geometry lives in the src svg and is written once; only the
|
||||
# words are repeated, which is the same split as ::: {.fr} / ::: {.de} in the
|
||||
# chapters.
|
||||
#
|
||||
# `alt` is the figure's accessible description (the svg <title>); it is read by
|
||||
# a screen reader, so it says what the picture shows, not that it is a picture.
|
||||
#
|
||||
# Identifiers from the tutorial (consoleIn.outbox, rot13/inbox, SensorService,
|
||||
# Mediator.java, .msg, WatchService, put, take) are never translated: they are
|
||||
# names in the code, and the tutorial's terminology is kept exactly.
|
||||
#
|
||||
# German runs long. Where a label would overflow its box, give it a size:
|
||||
# key: {en: "Primary key", de: {text: "Primärschlüssel", size: 10}}
|
||||
|
||||
direct-calls:
|
||||
alt:
|
||||
en: "The procedural version: inside one main(), IO.readln() is called, its result is passed to rot13(), and that result is passed to IO.println(). One thread, one process, three direct calls."
|
||||
fr: "La version procédurale : dans un seul main(), IO.readln() est appelé, son résultat est passé à rot13(), et ce résultat est passé à IO.println(). Un seul fil d'exécution, un seul processus, trois appels directs."
|
||||
de: "Die prozedurale Fassung: in einem einzigen main() wird IO.readln() aufgerufen, dessen Ergebnis an rot13() übergeben und dieses Ergebnis an IO.println(). Ein Thread, ein Prozess, drei direkte Aufrufe."
|
||||
frame:
|
||||
en: "one process · one thread · one main()"
|
||||
fr: "un processus · un fil · un seul main()"
|
||||
de: "ein Prozess · ein Thread · ein main()"
|
||||
read: {en: "IO.readln()", fr: "IO.readln()", de: "IO.readln()"}
|
||||
rot: {en: "rot13(text)", fr: "rot13(text)", de: "rot13(text)"}
|
||||
print: {en: "IO.println(…)", fr: "IO.println(…)", de: "IO.println(…)"}
|
||||
call1: {en: "call", fr: "appel", de: "Aufruf"}
|
||||
call2: {en: "call", fr: "appel", de: "Aufruf"}
|
||||
knows:
|
||||
en: "main() knows all three: their names, argument and result types, and that they are available right now."
|
||||
fr: "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."
|
||||
de: "main() kennt alle drei: ihre Namen, Argument- und Ergebnistypen und dass sie sofort verfügbar sind."
|
||||
cost:
|
||||
en: "The wiring is written into the code itself — step 1 of the tutorial."
|
||||
fr: "Le câblage est écrit dans le code lui-même — étape 1 du tutoriel."
|
||||
de: "Die Verdrahtung steht im Code selbst — Schritt 1 des Tutorials."
|
||||
|
||||
mailboxes-jvm:
|
||||
alt:
|
||||
en: "The mediated version inside one JVM: ConsoleIn puts a message into consoleIn.outbox, a mediator takes it and puts it into rot13.inbox, ROT13 takes it and puts its result into rot13.outbox, a second mediator moves that into consoleOut.inbox, and ConsoleOut takes it and prints it."
|
||||
fr: "La version médiatisée dans une seule JVM : ConsoleIn dépose un message dans consoleIn.outbox, un médiateur le retire et le dépose dans rot13.inbox, ROT13 le retire et dépose son résultat dans rot13.outbox, un second médiateur le déplace vers consoleOut.inbox, et ConsoleOut le retire et l'affiche."
|
||||
de: "Die vermittelte Fassung in einer JVM: ConsoleIn legt eine Nachricht in consoleIn.outbox, ein Vermittler nimmt sie und legt sie in rot13.inbox, ROT13 nimmt sie und legt sein Ergebnis in rot13.outbox, ein zweiter Vermittler verschiebt es nach consoleOut.inbox, und ConsoleOut nimmt es und gibt es aus."
|
||||
frame:
|
||||
en: "one JVM · five virtual threads · BlockingQueue mailboxes"
|
||||
fr: "une JVM · cinq threads virtuels · boîtes BlockingQueue"
|
||||
de: "eine JVM · fünf virtuelle Threads · BlockingQueue-Postfächer"
|
||||
consolein: {en: "ConsoleIn — “I read”", fr: "ConsoleIn — « je lis »", de: "ConsoleIn — „ich lese“"}
|
||||
rot13: {en: "ROT13 — “I rotate”", fr: "ROT13 — « je transforme »", de: "ROT13 — „ich rotiere“"}
|
||||
consoleout: {en: "ConsoleOut — “I print”", fr: "ConsoleOut — « j'affiche »", de: "ConsoleOut — „ich gebe aus“"}
|
||||
mediator1: {en: "Mediator", fr: "Médiateur", de: "Vermittler"}
|
||||
mediator2: {en: "Mediator", fr: "Médiateur", de: "Vermittler"}
|
||||
route1: {en: "consoleIn.outbox → rot13.inbox", fr: "consoleIn.outbox → rot13.inbox", de: "consoleIn.outbox → rot13.inbox"}
|
||||
route2: {en: "rot13.outbox → consoleOut.inbox", fr: "rot13.outbox → consoleOut.inbox", de: "rot13.outbox → consoleOut.inbox"}
|
||||
put1: {en: "put", fr: "put", de: "put"}
|
||||
put2: {en: "put", fr: "put", de: "put"}
|
||||
put3: {en: "put", fr: "put", de: "put"}
|
||||
put4: {en: "put", fr: "put", de: "put"}
|
||||
take1: {en: "take", fr: "take", de: "take"}
|
||||
take2: {en: "take", fr: "take", de: "take"}
|
||||
take3: {en: "take", fr: "take", de: "take"}
|
||||
take4: {en: "take", fr: "take", de: "take"}
|
||||
topology:
|
||||
en: "No capability names another one. The topology lives only in the two mediators, started in main()."
|
||||
fr: "Aucune capacité ne nomme une autre. La topologie ne vit que dans les deux médiateurs, démarrés dans main()."
|
||||
de: "Keine Fähigkeit nennt eine andere. Die Topologie steckt nur in den zwei Vermittlern, gestartet in main()."
|
||||
|
||||
filesystem-processes:
|
||||
alt:
|
||||
en: "The same chain as five separate processes on one computer: SensorService publishes a .msg file into consoleIn/outbox, a Mediator process watches that directory and publishes a copy into rot13/inbox, ProcessorService publishes its result into rot13/outbox, a second Mediator process moves it into consoleOut/inbox, and ActuatorService prints it. The four directories form the message board on one local filesystem."
|
||||
fr: "La même chaîne sous forme de cinq processus distincts sur un seul ordinateur : SensorService publie un fichier .msg dans consoleIn/outbox, un processus Mediator surveille ce répertoire et publie une copie dans rot13/inbox, ProcessorService publie son résultat dans rot13/outbox, un second processus Mediator le déplace vers consoleOut/inbox, et ActuatorService l'affiche. Les quatre répertoires forment le tableau de messages sur un seul système de fichiers local."
|
||||
de: "Dieselbe Kette als fünf getrennte Prozesse auf einem Rechner: SensorService veröffentlicht eine .msg-Datei in consoleIn/outbox, ein Mediator-Prozess beobachtet dieses Verzeichnis und veröffentlicht eine Kopie in rot13/inbox, ProcessorService veröffentlicht sein Ergebnis in rot13/outbox, ein zweiter Mediator-Prozess verschiebt es nach consoleOut/inbox, und ActuatorService gibt es aus. Die vier Verzeichnisse bilden das Nachrichtenbrett auf einem lokalen Dateisystem."
|
||||
sensor: {en: "SensorService — ConsoleIn", fr: "SensorService — ConsoleIn", de: "SensorService — ConsoleIn"}
|
||||
processor: {en: "ProcessorService — ROT13", fr: "ProcessorService — ROT13", de: "ProcessorService — ROT13"}
|
||||
actuator: {en: "ActuatorService — ConsoleOut", fr: "ActuatorService — ConsoleOut", de: "ActuatorService — ConsoleOut"}
|
||||
mediator1: {en: "Mediator.java consoleIn/outbox rot13/inbox", fr: "Mediator.java consoleIn/outbox rot13/inbox", de: {text: "Mediator.java consoleIn/outbox rot13/inbox", size: 11}}
|
||||
mediator2: {en: "Mediator.java rot13/outbox consoleOut/inbox", fr: "Mediator.java rot13/outbox consoleOut/inbox", de: {text: "Mediator.java rot13/outbox consoleOut/inbox", size: 11}}
|
||||
t1: {en: "terminal 1", fr: "terminal 1", de: "Terminal 1"}
|
||||
t2: {en: "terminal 2", fr: "terminal 2", de: "Terminal 2"}
|
||||
t3: {en: "terminal 3", fr: "terminal 3", de: "Terminal 3"}
|
||||
t4: {en: "terminal 4", fr: "terminal 4", de: "Terminal 4"}
|
||||
t5: {en: "terminal 5", fr: "terminal 5", de: "Terminal 5"}
|
||||
publish1: {en: "publish (.tmp → .msg)", fr: "publier (.tmp → .msg)", de: "veröffentlichen (.tmp → .msg)"}
|
||||
publish2: {en: "publish", fr: "publier", de: "veröffentlichen"}
|
||||
publish3: {en: "publish", fr: "publier", de: "veröffentlichen"}
|
||||
publish4: {en: "publish", fr: "publier", de: "veröffentlichen"}
|
||||
watch1: {en: "WatchService", fr: "WatchService", de: "WatchService"}
|
||||
watch2: {en: "WatchService", fr: "WatchService", de: "WatchService"}
|
||||
watch3: {en: "WatchService", fr: "WatchService", de: "WatchService"}
|
||||
watch4: {en: "WatchService", fr: "WatchService", de: "WatchService"}
|
||||
board:
|
||||
en: "directory = mailbox, file = message"
|
||||
fr: "répertoire = boîte, fichier = message"
|
||||
de: "Verzeichnis = Postfach, Datei = Nachricht"
|
||||
topology:
|
||||
en: "Five processes started by hand. The topology now lives in the two Mediator command lines — in whoever typed them."
|
||||
fr: "Cinq processus lancés à la main. La topologie vit désormais dans les deux lignes de commande Mediator — chez celui qui les a tapées."
|
||||
de: "Fünf von Hand gestartete Prozesse. Die Topologie steckt nun in den zwei Mediator-Befehlszeilen — bei dem, der sie getippt hat."
|
||||
@@ -0,0 +1,206 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 560 700" width="560" height="700"
|
||||
role="img" aria-labelledby="mj-title">
|
||||
<title id="mj-title">Die vermittelte Fassung in einer JVM: ConsoleIn legt eine Nachricht in consoleIn.outbox, ein Vermittler nimmt sie und legt sie in rot13.inbox, ROT13 nimmt sie und legt sein Ergebnis in rot13.outbox, ein zweiter Vermittler verschiebt es nach consoleOut.inbox, und ConsoleOut nimmt es und gibt es aus.</title>
|
||||
<style><![CDATA[
|
||||
/* figures/diagram.css -- shared look of every built figure.
|
||||
*
|
||||
* build-figures.py drops this file into the style element of every built
|
||||
* svg, so a figure carries its own styling and stays self-contained.
|
||||
* Classes, not per-element fills, do the work: one edit here restyles the
|
||||
* whole book.
|
||||
*
|
||||
* The palette is theme.scss's: teal #20666f for structure, amber #8a5a08 for
|
||||
* the warning accent, ink #1b2430 for text, IBM Plex to match the page.
|
||||
*
|
||||
* Dark theme: the @media block follows the reader's system setting. librsvg
|
||||
* ignores media queries when it makes the pdf, so print always gets the light
|
||||
* theme -- which is what a printed page wants.
|
||||
*/
|
||||
|
||||
svg {
|
||||
font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
|
||||
/* the figure sits on the page, not on a white card of its own */
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
/* ---- surfaces ------------------------------------------------------- */
|
||||
|
||||
.box { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
||||
.box-weak { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
||||
.box-accent { fill: #e5eff1; stroke: #20666f; stroke-width: 1.8; }
|
||||
.box-warn { fill: #f8f1e0; stroke: #8a5a08; stroke-width: 1.4; }
|
||||
.box-plain { fill: #fbfcfd; stroke: #dae0e8; stroke-width: 1.2; }
|
||||
.diamond { fill: #e5eff1; stroke: #20666f; stroke-width: 1.4; }
|
||||
.ellipse { fill: #fbfcfd; stroke: #5a6879; stroke-width: 1.2; }
|
||||
|
||||
/* ---- lines ---------------------------------------------------------- */
|
||||
|
||||
.edge { fill: none; stroke: #5a6879; stroke-width: 1.3; }
|
||||
.edge-strong{ fill: none; stroke: #20666f; stroke-width: 1.8; }
|
||||
.edge-warn { fill: none; stroke: #8a5a08; stroke-width: 1.6; }
|
||||
.edge-dash { fill: none; stroke: #5a6879; stroke-width: 1.2; stroke-dasharray: 5 3; }
|
||||
.rule { stroke: #dae0e8; stroke-width: 1; }
|
||||
|
||||
/* ---- text ----------------------------------------------------------- */
|
||||
|
||||
.t { fill: #1b2430; font-size: 13px; }
|
||||
.t-sm { fill: #1b2430; font-size: 11px; }
|
||||
.t-lead { fill: #1b2430; font-size: 14px; font-weight: 600; }
|
||||
.t-mut { fill: #5a6879; font-size: 11px; }
|
||||
.t-key { fill: #1b2430; font-size: 12px; text-decoration: underline; }
|
||||
.t-accent { fill: #20666f; font-size: 12px; font-weight: 600; }
|
||||
.t-warn { fill: #8a5a08; font-size: 12px; font-weight: 600; }
|
||||
.t-mono { fill: #1b2430; font-size: 11.5px;
|
||||
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
|
||||
|
||||
.mid { text-anchor: middle; }
|
||||
.end { text-anchor: end; }
|
||||
|
||||
/* ---- interaction ====================================================
|
||||
* A .node groups one box with its labels. Hovering it lifts the whole group
|
||||
* a little, which is enough to follow a path through a busy diagram without
|
||||
* any script. Pointer events stay off the decorative layers so the hover
|
||||
* target is the shape itself.
|
||||
*/
|
||||
|
||||
.node { transition: opacity .12s ease; }
|
||||
.node:hover .box,
|
||||
.node:hover .box-accent,
|
||||
.node:hover .diamond { stroke-width: 2.6; }
|
||||
.node:hover .t, .node:hover .t-lead { fill: #20666f; }
|
||||
|
||||
svg:hover .node:not(:hover) { opacity: .55; }
|
||||
|
||||
/* a figure that marks no nodes must not dim on hover */
|
||||
svg:not(:has(.node)) .node { opacity: 1; }
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.node { transition: none; }
|
||||
}
|
||||
|
||||
/* ---- dark theme ------------------------------------------------------ */
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.box { fill: #1d2b33; stroke: #4c9aa5; }
|
||||
.box-weak { fill: #1d2b33; stroke: #4c9aa5; }
|
||||
.box-accent { fill: #24363d; stroke: #4c9aa5; }
|
||||
.box-warn { fill: #332a18; stroke: #c99a3a; }
|
||||
.box-plain { fill: #161b22; stroke: #30363d; }
|
||||
.diamond { fill: #24363d; stroke: #4c9aa5; }
|
||||
.ellipse { fill: #161b22; stroke: #8b98a8; }
|
||||
|
||||
.edge { stroke: #8b98a8; }
|
||||
.edge-strong{ stroke: #4c9aa5; }
|
||||
.edge-warn { stroke: #c99a3a; }
|
||||
.edge-dash { stroke: #8b98a8; }
|
||||
.rule { stroke: #30363d; }
|
||||
|
||||
.t, .t-sm, .t-lead, .t-key, .t-mono { fill: #e6edf3; }
|
||||
.t-mut { fill: #8b98a8; }
|
||||
.t-accent { fill: #4c9aa5; }
|
||||
.t-warn { fill: #c99a3a; }
|
||||
|
||||
.node:hover .t, .node:hover .t-lead { fill: #7fc4cf; }
|
||||
|
||||
.arrow { fill: #8b98a8; }
|
||||
.arrow-strong { fill: #4c9aa5; }
|
||||
.arrow-warn { fill: #c99a3a; }
|
||||
}
|
||||
|
||||
/* ---- arrowheads ======================================================
|
||||
* marker contents cannot inherit the referencing element's fill, so each
|
||||
* arrowhead is its own class and is themed alongside the line it ends.
|
||||
*/
|
||||
|
||||
.arrow { fill: #5a6879; }
|
||||
.arrow-strong { fill: #20666f; }
|
||||
.arrow-warn { fill: #8a5a08; }
|
||||
|
||||
]]></style>
|
||||
|
||||
<defs>
|
||||
<marker id="a" viewBox="0 0 10 10" refX="9" refY="5"
|
||||
markerWidth="6.5" markerHeight="6.5" orient="auto-start-reverse">
|
||||
<path class="arrow" d="M0,0 L10,5 L0,10 z"/>
|
||||
</marker>
|
||||
</defs>
|
||||
|
||||
<!-- one JVM, five virtual threads: the frame the whole chain lives in -->
|
||||
<rect class="box-plain" x="10" y="10" width="540" height="676" rx="4"/>
|
||||
<text class="t-mut" data-label="frame" x="22" y="30">eine JVM · fünf virtuelle Threads · BlockingQueue-Postfächer</text>
|
||||
|
||||
<!-- 1. ConsoleIn ==================================================== -->
|
||||
<g class="node" data-flow-node="consolein">
|
||||
<rect class="box" x="120" y="44" width="300" height="44" rx="3"/>
|
||||
<text class="t-lead mid" data-label="consolein" x="270" y="72">ConsoleIn — „ich lese“</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="1" data-flow-to="outbox1" d="M270,88 V114" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="put1" x="286" y="106">put</text>
|
||||
|
||||
<!-- 2. consoleIn.outbox ============================================= -->
|
||||
<g class="node" data-flow-node="outbox1">
|
||||
<rect class="box-plain" x="120" y="116" width="300" height="44" rx="3"/>
|
||||
<text class="t-mono mid" x="270" y="144">consoleIn.outbox</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="2" data-flow-to="mediator1" d="M270,160 V186" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="take1" x="286" y="178">take</text>
|
||||
|
||||
<!-- 3. first mediator =============================================== -->
|
||||
<g class="node" data-flow-node="mediator1">
|
||||
<rect class="box-accent" x="120" y="188" width="300" height="44" rx="3"/>
|
||||
<text class="t-lead mid" data-label="mediator1" x="270" y="211">Vermittler</text>
|
||||
<text class="t-mut mid" data-label="route1" x="270" y="226">consoleIn.outbox → rot13.inbox</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="3" data-flow-to="inbox2" d="M270,232 V258" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="put2" x="286" y="250">put</text>
|
||||
|
||||
<!-- 4. rot13.inbox =================================================== -->
|
||||
<g class="node" data-flow-node="inbox2">
|
||||
<rect class="box-plain" x="120" y="260" width="300" height="44" rx="3"/>
|
||||
<text class="t-mono mid" x="270" y="288">rot13.inbox</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="4" data-flow-to="rot13" d="M270,304 V330" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="take2" x="286" y="322">take</text>
|
||||
|
||||
<!-- 5. ROT13 ========================================================= -->
|
||||
<g class="node" data-flow-node="rot13">
|
||||
<rect class="box" x="120" y="332" width="300" height="44" rx="3"/>
|
||||
<text class="t-lead mid" data-label="rot13" x="270" y="360">ROT13 — „ich rotiere“</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="5" data-flow-to="outbox2" d="M270,376 V402" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="put3" x="286" y="394">put</text>
|
||||
|
||||
<!-- 6. rot13.outbox ================================================== -->
|
||||
<g class="node" data-flow-node="outbox2">
|
||||
<rect class="box-plain" x="120" y="404" width="300" height="44" rx="3"/>
|
||||
<text class="t-mono mid" x="270" y="432">rot13.outbox</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="6" data-flow-to="mediator2" d="M270,448 V474" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="take3" x="286" y="466">take</text>
|
||||
|
||||
<!-- 7. second mediator =============================================== -->
|
||||
<g class="node" data-flow-node="mediator2">
|
||||
<rect class="box-accent" x="120" y="476" width="300" height="44" rx="3"/>
|
||||
<text class="t-lead mid" data-label="mediator2" x="270" y="499">Vermittler</text>
|
||||
<text class="t-mut mid" data-label="route2" x="270" y="514">rot13.outbox → consoleOut.inbox</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="7" data-flow-to="inbox3" d="M270,520 V546" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="put4" x="286" y="538">put</text>
|
||||
|
||||
<!-- 8. consoleOut.inbox ============================================== -->
|
||||
<g class="node" data-flow-node="inbox3">
|
||||
<rect class="box-plain" x="120" y="548" width="300" height="44" rx="3"/>
|
||||
<text class="t-mono mid" x="270" y="576">consoleOut.inbox</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="8" data-flow-to="consoleout" d="M270,592 V618" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="take4" x="286" y="610">take</text>
|
||||
|
||||
<!-- 9. ConsoleOut ==================================================== -->
|
||||
<g class="node" data-flow-node="consoleout">
|
||||
<rect class="box" x="120" y="620" width="300" height="44" rx="3"/>
|
||||
<text class="t-lead mid" data-label="consoleout" x="270" y="648">ConsoleOut — „ich gebe aus“</text>
|
||||
</g>
|
||||
|
||||
<!-- side note: who holds the topology -->
|
||||
<text class="t-warn" data-label="topology" x="22" y="672">Keine Fähigkeit nennt eine andere. Die Topologie steckt nur in den zwei Vermittlern, gestartet in main().</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 9.7 KiB |
@@ -0,0 +1,206 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 560 700" width="560" height="700"
|
||||
role="img" aria-labelledby="mj-title">
|
||||
<title id="mj-title">The mediated version inside one JVM: ConsoleIn puts a message into consoleIn.outbox, a mediator takes it and puts it into rot13.inbox, ROT13 takes it and puts its result into rot13.outbox, a second mediator moves that into consoleOut.inbox, and ConsoleOut takes it and prints it.</title>
|
||||
<style><![CDATA[
|
||||
/* figures/diagram.css -- shared look of every built figure.
|
||||
*
|
||||
* build-figures.py drops this file into the style element of every built
|
||||
* svg, so a figure carries its own styling and stays self-contained.
|
||||
* Classes, not per-element fills, do the work: one edit here restyles the
|
||||
* whole book.
|
||||
*
|
||||
* The palette is theme.scss's: teal #20666f for structure, amber #8a5a08 for
|
||||
* the warning accent, ink #1b2430 for text, IBM Plex to match the page.
|
||||
*
|
||||
* Dark theme: the @media block follows the reader's system setting. librsvg
|
||||
* ignores media queries when it makes the pdf, so print always gets the light
|
||||
* theme -- which is what a printed page wants.
|
||||
*/
|
||||
|
||||
svg {
|
||||
font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
|
||||
/* the figure sits on the page, not on a white card of its own */
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
/* ---- surfaces ------------------------------------------------------- */
|
||||
|
||||
.box { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
||||
.box-weak { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
||||
.box-accent { fill: #e5eff1; stroke: #20666f; stroke-width: 1.8; }
|
||||
.box-warn { fill: #f8f1e0; stroke: #8a5a08; stroke-width: 1.4; }
|
||||
.box-plain { fill: #fbfcfd; stroke: #dae0e8; stroke-width: 1.2; }
|
||||
.diamond { fill: #e5eff1; stroke: #20666f; stroke-width: 1.4; }
|
||||
.ellipse { fill: #fbfcfd; stroke: #5a6879; stroke-width: 1.2; }
|
||||
|
||||
/* ---- lines ---------------------------------------------------------- */
|
||||
|
||||
.edge { fill: none; stroke: #5a6879; stroke-width: 1.3; }
|
||||
.edge-strong{ fill: none; stroke: #20666f; stroke-width: 1.8; }
|
||||
.edge-warn { fill: none; stroke: #8a5a08; stroke-width: 1.6; }
|
||||
.edge-dash { fill: none; stroke: #5a6879; stroke-width: 1.2; stroke-dasharray: 5 3; }
|
||||
.rule { stroke: #dae0e8; stroke-width: 1; }
|
||||
|
||||
/* ---- text ----------------------------------------------------------- */
|
||||
|
||||
.t { fill: #1b2430; font-size: 13px; }
|
||||
.t-sm { fill: #1b2430; font-size: 11px; }
|
||||
.t-lead { fill: #1b2430; font-size: 14px; font-weight: 600; }
|
||||
.t-mut { fill: #5a6879; font-size: 11px; }
|
||||
.t-key { fill: #1b2430; font-size: 12px; text-decoration: underline; }
|
||||
.t-accent { fill: #20666f; font-size: 12px; font-weight: 600; }
|
||||
.t-warn { fill: #8a5a08; font-size: 12px; font-weight: 600; }
|
||||
.t-mono { fill: #1b2430; font-size: 11.5px;
|
||||
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
|
||||
|
||||
.mid { text-anchor: middle; }
|
||||
.end { text-anchor: end; }
|
||||
|
||||
/* ---- interaction ====================================================
|
||||
* A .node groups one box with its labels. Hovering it lifts the whole group
|
||||
* a little, which is enough to follow a path through a busy diagram without
|
||||
* any script. Pointer events stay off the decorative layers so the hover
|
||||
* target is the shape itself.
|
||||
*/
|
||||
|
||||
.node { transition: opacity .12s ease; }
|
||||
.node:hover .box,
|
||||
.node:hover .box-accent,
|
||||
.node:hover .diamond { stroke-width: 2.6; }
|
||||
.node:hover .t, .node:hover .t-lead { fill: #20666f; }
|
||||
|
||||
svg:hover .node:not(:hover) { opacity: .55; }
|
||||
|
||||
/* a figure that marks no nodes must not dim on hover */
|
||||
svg:not(:has(.node)) .node { opacity: 1; }
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.node { transition: none; }
|
||||
}
|
||||
|
||||
/* ---- dark theme ------------------------------------------------------ */
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.box { fill: #1d2b33; stroke: #4c9aa5; }
|
||||
.box-weak { fill: #1d2b33; stroke: #4c9aa5; }
|
||||
.box-accent { fill: #24363d; stroke: #4c9aa5; }
|
||||
.box-warn { fill: #332a18; stroke: #c99a3a; }
|
||||
.box-plain { fill: #161b22; stroke: #30363d; }
|
||||
.diamond { fill: #24363d; stroke: #4c9aa5; }
|
||||
.ellipse { fill: #161b22; stroke: #8b98a8; }
|
||||
|
||||
.edge { stroke: #8b98a8; }
|
||||
.edge-strong{ stroke: #4c9aa5; }
|
||||
.edge-warn { stroke: #c99a3a; }
|
||||
.edge-dash { stroke: #8b98a8; }
|
||||
.rule { stroke: #30363d; }
|
||||
|
||||
.t, .t-sm, .t-lead, .t-key, .t-mono { fill: #e6edf3; }
|
||||
.t-mut { fill: #8b98a8; }
|
||||
.t-accent { fill: #4c9aa5; }
|
||||
.t-warn { fill: #c99a3a; }
|
||||
|
||||
.node:hover .t, .node:hover .t-lead { fill: #7fc4cf; }
|
||||
|
||||
.arrow { fill: #8b98a8; }
|
||||
.arrow-strong { fill: #4c9aa5; }
|
||||
.arrow-warn { fill: #c99a3a; }
|
||||
}
|
||||
|
||||
/* ---- arrowheads ======================================================
|
||||
* marker contents cannot inherit the referencing element's fill, so each
|
||||
* arrowhead is its own class and is themed alongside the line it ends.
|
||||
*/
|
||||
|
||||
.arrow { fill: #5a6879; }
|
||||
.arrow-strong { fill: #20666f; }
|
||||
.arrow-warn { fill: #8a5a08; }
|
||||
|
||||
]]></style>
|
||||
|
||||
<defs>
|
||||
<marker id="a" viewBox="0 0 10 10" refX="9" refY="5"
|
||||
markerWidth="6.5" markerHeight="6.5" orient="auto-start-reverse">
|
||||
<path class="arrow" d="M0,0 L10,5 L0,10 z"/>
|
||||
</marker>
|
||||
</defs>
|
||||
|
||||
<!-- one JVM, five virtual threads: the frame the whole chain lives in -->
|
||||
<rect class="box-plain" x="10" y="10" width="540" height="676" rx="4"/>
|
||||
<text class="t-mut" data-label="frame" x="22" y="30">one JVM · five virtual threads · BlockingQueue mailboxes</text>
|
||||
|
||||
<!-- 1. ConsoleIn ==================================================== -->
|
||||
<g class="node" data-flow-node="consolein">
|
||||
<rect class="box" x="120" y="44" width="300" height="44" rx="3"/>
|
||||
<text class="t-lead mid" data-label="consolein" x="270" y="72">ConsoleIn — “I read”</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="1" data-flow-to="outbox1" d="M270,88 V114" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="put1" x="286" y="106">put</text>
|
||||
|
||||
<!-- 2. consoleIn.outbox ============================================= -->
|
||||
<g class="node" data-flow-node="outbox1">
|
||||
<rect class="box-plain" x="120" y="116" width="300" height="44" rx="3"/>
|
||||
<text class="t-mono mid" x="270" y="144">consoleIn.outbox</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="2" data-flow-to="mediator1" d="M270,160 V186" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="take1" x="286" y="178">take</text>
|
||||
|
||||
<!-- 3. first mediator =============================================== -->
|
||||
<g class="node" data-flow-node="mediator1">
|
||||
<rect class="box-accent" x="120" y="188" width="300" height="44" rx="3"/>
|
||||
<text class="t-lead mid" data-label="mediator1" x="270" y="211">Mediator</text>
|
||||
<text class="t-mut mid" data-label="route1" x="270" y="226">consoleIn.outbox → rot13.inbox</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="3" data-flow-to="inbox2" d="M270,232 V258" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="put2" x="286" y="250">put</text>
|
||||
|
||||
<!-- 4. rot13.inbox =================================================== -->
|
||||
<g class="node" data-flow-node="inbox2">
|
||||
<rect class="box-plain" x="120" y="260" width="300" height="44" rx="3"/>
|
||||
<text class="t-mono mid" x="270" y="288">rot13.inbox</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="4" data-flow-to="rot13" d="M270,304 V330" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="take2" x="286" y="322">take</text>
|
||||
|
||||
<!-- 5. ROT13 ========================================================= -->
|
||||
<g class="node" data-flow-node="rot13">
|
||||
<rect class="box" x="120" y="332" width="300" height="44" rx="3"/>
|
||||
<text class="t-lead mid" data-label="rot13" x="270" y="360">ROT13 — “I rotate”</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="5" data-flow-to="outbox2" d="M270,376 V402" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="put3" x="286" y="394">put</text>
|
||||
|
||||
<!-- 6. rot13.outbox ================================================== -->
|
||||
<g class="node" data-flow-node="outbox2">
|
||||
<rect class="box-plain" x="120" y="404" width="300" height="44" rx="3"/>
|
||||
<text class="t-mono mid" x="270" y="432">rot13.outbox</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="6" data-flow-to="mediator2" d="M270,448 V474" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="take3" x="286" y="466">take</text>
|
||||
|
||||
<!-- 7. second mediator =============================================== -->
|
||||
<g class="node" data-flow-node="mediator2">
|
||||
<rect class="box-accent" x="120" y="476" width="300" height="44" rx="3"/>
|
||||
<text class="t-lead mid" data-label="mediator2" x="270" y="499">Mediator</text>
|
||||
<text class="t-mut mid" data-label="route2" x="270" y="514">rot13.outbox → consoleOut.inbox</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="7" data-flow-to="inbox3" d="M270,520 V546" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="put4" x="286" y="538">put</text>
|
||||
|
||||
<!-- 8. consoleOut.inbox ============================================== -->
|
||||
<g class="node" data-flow-node="inbox3">
|
||||
<rect class="box-plain" x="120" y="548" width="300" height="44" rx="3"/>
|
||||
<text class="t-mono mid" x="270" y="576">consoleOut.inbox</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="8" data-flow-to="consoleout" d="M270,592 V618" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="take4" x="286" y="610">take</text>
|
||||
|
||||
<!-- 9. ConsoleOut ==================================================== -->
|
||||
<g class="node" data-flow-node="consoleout">
|
||||
<rect class="box" x="120" y="620" width="300" height="44" rx="3"/>
|
||||
<text class="t-lead mid" data-label="consoleout" x="270" y="648">ConsoleOut — “I print”</text>
|
||||
</g>
|
||||
|
||||
<!-- side note: who holds the topology -->
|
||||
<text class="t-warn" data-label="topology" x="22" y="672">No capability names another one. The topology lives only in the two mediators, started in main().</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 9.6 KiB |
@@ -0,0 +1,206 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 560 700" width="560" height="700"
|
||||
role="img" aria-labelledby="mj-title">
|
||||
<title id="mj-title">La version médiatisée dans une seule JVM : ConsoleIn dépose un message dans consoleIn.outbox, un médiateur le retire et le dépose dans rot13.inbox, ROT13 le retire et dépose son résultat dans rot13.outbox, un second médiateur le déplace vers consoleOut.inbox, et ConsoleOut le retire et l'affiche.</title>
|
||||
<style><![CDATA[
|
||||
/* figures/diagram.css -- shared look of every built figure.
|
||||
*
|
||||
* build-figures.py drops this file into the style element of every built
|
||||
* svg, so a figure carries its own styling and stays self-contained.
|
||||
* Classes, not per-element fills, do the work: one edit here restyles the
|
||||
* whole book.
|
||||
*
|
||||
* The palette is theme.scss's: teal #20666f for structure, amber #8a5a08 for
|
||||
* the warning accent, ink #1b2430 for text, IBM Plex to match the page.
|
||||
*
|
||||
* Dark theme: the @media block follows the reader's system setting. librsvg
|
||||
* ignores media queries when it makes the pdf, so print always gets the light
|
||||
* theme -- which is what a printed page wants.
|
||||
*/
|
||||
|
||||
svg {
|
||||
font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
|
||||
/* the figure sits on the page, not on a white card of its own */
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
/* ---- surfaces ------------------------------------------------------- */
|
||||
|
||||
.box { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
||||
.box-weak { fill: #eef3f7; stroke: #20666f; stroke-width: 1.4; }
|
||||
.box-accent { fill: #e5eff1; stroke: #20666f; stroke-width: 1.8; }
|
||||
.box-warn { fill: #f8f1e0; stroke: #8a5a08; stroke-width: 1.4; }
|
||||
.box-plain { fill: #fbfcfd; stroke: #dae0e8; stroke-width: 1.2; }
|
||||
.diamond { fill: #e5eff1; stroke: #20666f; stroke-width: 1.4; }
|
||||
.ellipse { fill: #fbfcfd; stroke: #5a6879; stroke-width: 1.2; }
|
||||
|
||||
/* ---- lines ---------------------------------------------------------- */
|
||||
|
||||
.edge { fill: none; stroke: #5a6879; stroke-width: 1.3; }
|
||||
.edge-strong{ fill: none; stroke: #20666f; stroke-width: 1.8; }
|
||||
.edge-warn { fill: none; stroke: #8a5a08; stroke-width: 1.6; }
|
||||
.edge-dash { fill: none; stroke: #5a6879; stroke-width: 1.2; stroke-dasharray: 5 3; }
|
||||
.rule { stroke: #dae0e8; stroke-width: 1; }
|
||||
|
||||
/* ---- text ----------------------------------------------------------- */
|
||||
|
||||
.t { fill: #1b2430; font-size: 13px; }
|
||||
.t-sm { fill: #1b2430; font-size: 11px; }
|
||||
.t-lead { fill: #1b2430; font-size: 14px; font-weight: 600; }
|
||||
.t-mut { fill: #5a6879; font-size: 11px; }
|
||||
.t-key { fill: #1b2430; font-size: 12px; text-decoration: underline; }
|
||||
.t-accent { fill: #20666f; font-size: 12px; font-weight: 600; }
|
||||
.t-warn { fill: #8a5a08; font-size: 12px; font-weight: 600; }
|
||||
.t-mono { fill: #1b2430; font-size: 11.5px;
|
||||
font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
|
||||
|
||||
.mid { text-anchor: middle; }
|
||||
.end { text-anchor: end; }
|
||||
|
||||
/* ---- interaction ====================================================
|
||||
* A .node groups one box with its labels. Hovering it lifts the whole group
|
||||
* a little, which is enough to follow a path through a busy diagram without
|
||||
* any script. Pointer events stay off the decorative layers so the hover
|
||||
* target is the shape itself.
|
||||
*/
|
||||
|
||||
.node { transition: opacity .12s ease; }
|
||||
.node:hover .box,
|
||||
.node:hover .box-accent,
|
||||
.node:hover .diamond { stroke-width: 2.6; }
|
||||
.node:hover .t, .node:hover .t-lead { fill: #20666f; }
|
||||
|
||||
svg:hover .node:not(:hover) { opacity: .55; }
|
||||
|
||||
/* a figure that marks no nodes must not dim on hover */
|
||||
svg:not(:has(.node)) .node { opacity: 1; }
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.node { transition: none; }
|
||||
}
|
||||
|
||||
/* ---- dark theme ------------------------------------------------------ */
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.box { fill: #1d2b33; stroke: #4c9aa5; }
|
||||
.box-weak { fill: #1d2b33; stroke: #4c9aa5; }
|
||||
.box-accent { fill: #24363d; stroke: #4c9aa5; }
|
||||
.box-warn { fill: #332a18; stroke: #c99a3a; }
|
||||
.box-plain { fill: #161b22; stroke: #30363d; }
|
||||
.diamond { fill: #24363d; stroke: #4c9aa5; }
|
||||
.ellipse { fill: #161b22; stroke: #8b98a8; }
|
||||
|
||||
.edge { stroke: #8b98a8; }
|
||||
.edge-strong{ stroke: #4c9aa5; }
|
||||
.edge-warn { stroke: #c99a3a; }
|
||||
.edge-dash { stroke: #8b98a8; }
|
||||
.rule { stroke: #30363d; }
|
||||
|
||||
.t, .t-sm, .t-lead, .t-key, .t-mono { fill: #e6edf3; }
|
||||
.t-mut { fill: #8b98a8; }
|
||||
.t-accent { fill: #4c9aa5; }
|
||||
.t-warn { fill: #c99a3a; }
|
||||
|
||||
.node:hover .t, .node:hover .t-lead { fill: #7fc4cf; }
|
||||
|
||||
.arrow { fill: #8b98a8; }
|
||||
.arrow-strong { fill: #4c9aa5; }
|
||||
.arrow-warn { fill: #c99a3a; }
|
||||
}
|
||||
|
||||
/* ---- arrowheads ======================================================
|
||||
* marker contents cannot inherit the referencing element's fill, so each
|
||||
* arrowhead is its own class and is themed alongside the line it ends.
|
||||
*/
|
||||
|
||||
.arrow { fill: #5a6879; }
|
||||
.arrow-strong { fill: #20666f; }
|
||||
.arrow-warn { fill: #8a5a08; }
|
||||
|
||||
]]></style>
|
||||
|
||||
<defs>
|
||||
<marker id="a" viewBox="0 0 10 10" refX="9" refY="5"
|
||||
markerWidth="6.5" markerHeight="6.5" orient="auto-start-reverse">
|
||||
<path class="arrow" d="M0,0 L10,5 L0,10 z"/>
|
||||
</marker>
|
||||
</defs>
|
||||
|
||||
<!-- one JVM, five virtual threads: the frame the whole chain lives in -->
|
||||
<rect class="box-plain" x="10" y="10" width="540" height="676" rx="4"/>
|
||||
<text class="t-mut" data-label="frame" x="22" y="30">une JVM · cinq threads virtuels · boîtes BlockingQueue</text>
|
||||
|
||||
<!-- 1. ConsoleIn ==================================================== -->
|
||||
<g class="node" data-flow-node="consolein">
|
||||
<rect class="box" x="120" y="44" width="300" height="44" rx="3"/>
|
||||
<text class="t-lead mid" data-label="consolein" x="270" y="72">ConsoleIn — « je lis »</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="1" data-flow-to="outbox1" d="M270,88 V114" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="put1" x="286" y="106">put</text>
|
||||
|
||||
<!-- 2. consoleIn.outbox ============================================= -->
|
||||
<g class="node" data-flow-node="outbox1">
|
||||
<rect class="box-plain" x="120" y="116" width="300" height="44" rx="3"/>
|
||||
<text class="t-mono mid" x="270" y="144">consoleIn.outbox</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="2" data-flow-to="mediator1" d="M270,160 V186" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="take1" x="286" y="178">take</text>
|
||||
|
||||
<!-- 3. first mediator =============================================== -->
|
||||
<g class="node" data-flow-node="mediator1">
|
||||
<rect class="box-accent" x="120" y="188" width="300" height="44" rx="3"/>
|
||||
<text class="t-lead mid" data-label="mediator1" x="270" y="211">Médiateur</text>
|
||||
<text class="t-mut mid" data-label="route1" x="270" y="226">consoleIn.outbox → rot13.inbox</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="3" data-flow-to="inbox2" d="M270,232 V258" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="put2" x="286" y="250">put</text>
|
||||
|
||||
<!-- 4. rot13.inbox =================================================== -->
|
||||
<g class="node" data-flow-node="inbox2">
|
||||
<rect class="box-plain" x="120" y="260" width="300" height="44" rx="3"/>
|
||||
<text class="t-mono mid" x="270" y="288">rot13.inbox</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="4" data-flow-to="rot13" d="M270,304 V330" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="take2" x="286" y="322">take</text>
|
||||
|
||||
<!-- 5. ROT13 ========================================================= -->
|
||||
<g class="node" data-flow-node="rot13">
|
||||
<rect class="box" x="120" y="332" width="300" height="44" rx="3"/>
|
||||
<text class="t-lead mid" data-label="rot13" x="270" y="360">ROT13 — « je transforme »</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="5" data-flow-to="outbox2" d="M270,376 V402" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="put3" x="286" y="394">put</text>
|
||||
|
||||
<!-- 6. rot13.outbox ================================================== -->
|
||||
<g class="node" data-flow-node="outbox2">
|
||||
<rect class="box-plain" x="120" y="404" width="300" height="44" rx="3"/>
|
||||
<text class="t-mono mid" x="270" y="432">rot13.outbox</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="6" data-flow-to="mediator2" d="M270,448 V474" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="take3" x="286" y="466">take</text>
|
||||
|
||||
<!-- 7. second mediator =============================================== -->
|
||||
<g class="node" data-flow-node="mediator2">
|
||||
<rect class="box-accent" x="120" y="476" width="300" height="44" rx="3"/>
|
||||
<text class="t-lead mid" data-label="mediator2" x="270" y="499">Médiateur</text>
|
||||
<text class="t-mut mid" data-label="route2" x="270" y="514">rot13.outbox → consoleOut.inbox</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="7" data-flow-to="inbox3" d="M270,520 V546" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="put4" x="286" y="538">put</text>
|
||||
|
||||
<!-- 8. consoleOut.inbox ============================================== -->
|
||||
<g class="node" data-flow-node="inbox3">
|
||||
<rect class="box-plain" x="120" y="548" width="300" height="44" rx="3"/>
|
||||
<text class="t-mono mid" x="270" y="576">consoleOut.inbox</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="8" data-flow-to="consoleout" d="M270,592 V618" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="take4" x="286" y="610">take</text>
|
||||
|
||||
<!-- 9. ConsoleOut ==================================================== -->
|
||||
<g class="node" data-flow-node="consoleout">
|
||||
<rect class="box" x="120" y="620" width="300" height="44" rx="3"/>
|
||||
<text class="t-lead mid" data-label="consoleout" x="270" y="648">ConsoleOut — « j'affiche »</text>
|
||||
</g>
|
||||
|
||||
<!-- side note: who holds the topology -->
|
||||
<text class="t-warn" data-label="topology" x="22" y="672">Aucune capacité ne nomme une autre. La topologie ne vit que dans les deux médiateurs, démarrés dans main().</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 9.7 KiB |
@@ -0,0 +1,41 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 760 230" width="760" height="230"
|
||||
role="img" aria-labelledby="dc-title">
|
||||
<title id="dc-title">{{alt}}</title>
|
||||
<style><!--CSS--></style>
|
||||
|
||||
<defs>
|
||||
<marker id="a" viewBox="0 0 10 10" refX="9" refY="5"
|
||||
markerWidth="6.5" markerHeight="6.5" orient="auto-start-reverse">
|
||||
<path class="arrow" d="M0,0 L10,5 L0,10 z"/>
|
||||
</marker>
|
||||
</defs>
|
||||
|
||||
<!-- everything happens inside one main(), on one thread -->
|
||||
<rect class="box-plain" x="14" y="16" width="732" height="126" rx="4"/>
|
||||
<text class="t-mut" data-label="frame" x="26" y="36">{{frame}}</text>
|
||||
|
||||
<g class="node" data-flow-node="read">
|
||||
<rect class="box" x="40" y="58" width="170" height="52" rx="3"/>
|
||||
<text class="t-mono mid" data-label="read" x="125" y="90">{{read}}</text>
|
||||
</g>
|
||||
|
||||
<path class="edge" data-flow="1" data-flow-to="rot" d="M210,84 H298" marker-end="url(#a)"/>
|
||||
<text class="t-accent mid" data-label="call1" x="254" y="72">{{call1}}</text>
|
||||
|
||||
<g class="node" data-flow-node="rot">
|
||||
<rect class="box" x="300" y="58" width="170" height="52" rx="3"/>
|
||||
<text class="t-mono mid" data-label="rot" x="385" y="90">{{rot}}</text>
|
||||
</g>
|
||||
|
||||
<path class="edge" data-flow="2" data-flow-to="print" d="M470,84 H558" marker-end="url(#a)"/>
|
||||
<text class="t-accent mid" data-label="call2" x="514" y="72">{{call2}}</text>
|
||||
|
||||
<g class="node" data-flow-node="print">
|
||||
<rect class="box" x="560" y="58" width="170" height="52" rx="3"/>
|
||||
<text class="t-mono mid" data-label="print" x="645" y="90">{{print}}</text>
|
||||
</g>
|
||||
|
||||
<!-- who knows whom -->
|
||||
<text class="t-sm" data-label="knows" x="14" y="176">{{knows}}</text>
|
||||
<text class="t-mut" data-label="cost" x="14" y="202">{{cost}}</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
@@ -0,0 +1,96 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 620 700" width="620" height="700"
|
||||
role="img" aria-labelledby="fp-title">
|
||||
<title id="fp-title">{{alt}}</title>
|
||||
<style><!--CSS--></style>
|
||||
|
||||
<defs>
|
||||
<marker id="a" viewBox="0 0 10 10" refX="9" refY="5"
|
||||
markerWidth="6.5" markerHeight="6.5" orient="auto-start-reverse">
|
||||
<path class="arrow" d="M0,0 L10,5 L0,10 z"/>
|
||||
</marker>
|
||||
</defs>
|
||||
|
||||
<!-- 1. SensorService (terminal 1) ==================================== -->
|
||||
<g class="node" data-flow-node="sensor">
|
||||
<rect class="box" x="120" y="24" width="300" height="46" rx="3"/>
|
||||
<text class="t-lead mid" data-label="sensor" x="270" y="46">{{sensor}}</text>
|
||||
<text class="t-mut mid" data-label="t1" x="270" y="62">{{t1}}</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="1" data-flow-to="outbox1" d="M270,70 V96" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="publish1" x="286" y="88">{{publish1}}</text>
|
||||
|
||||
<!-- 2. consoleIn/outbox ============================================= -->
|
||||
<g class="node" data-flow-node="outbox1">
|
||||
<rect class="box-plain" x="120" y="98" width="300" height="44" rx="3"/>
|
||||
<text class="t-mono mid" x="270" y="126">consoleIn/outbox/*.msg</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="2" data-flow-to="mediator1" d="M270,142 V168" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="watch1" x="286" y="160">{{watch1}}</text>
|
||||
|
||||
<!-- 3. first mediator process (terminal 2) =========================== -->
|
||||
<g class="node" data-flow-node="mediator1">
|
||||
<rect class="box-accent" x="120" y="170" width="300" height="46" rx="3"/>
|
||||
<text class="t-lead mid" data-label="mediator1" x="270" y="192">{{mediator1}}</text>
|
||||
<text class="t-mut mid" data-label="t2" x="270" y="208">{{t2}}</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="3" data-flow-to="inbox2" d="M270,216 V242" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="publish2" x="286" y="234">{{publish2}}</text>
|
||||
|
||||
<!-- 4. rot13/inbox =================================================== -->
|
||||
<g class="node" data-flow-node="inbox2">
|
||||
<rect class="box-plain" x="120" y="244" width="300" height="44" rx="3"/>
|
||||
<text class="t-mono mid" x="270" y="272">rot13/inbox/*.msg</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="4" data-flow-to="processor" d="M270,288 V314" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="watch2" x="286" y="306">{{watch2}}</text>
|
||||
|
||||
<!-- 5. ProcessorService (terminal 3) ================================= -->
|
||||
<g class="node" data-flow-node="processor">
|
||||
<rect class="box" x="120" y="316" width="300" height="46" rx="3"/>
|
||||
<text class="t-lead mid" data-label="processor" x="270" y="338">{{processor}}</text>
|
||||
<text class="t-mut mid" data-label="t3" x="270" y="354">{{t3}}</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="5" data-flow-to="outbox2" d="M270,362 V388" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="publish3" x="286" y="380">{{publish3}}</text>
|
||||
|
||||
<!-- 6. rot13/outbox ================================================== -->
|
||||
<g class="node" data-flow-node="outbox2">
|
||||
<rect class="box-plain" x="120" y="390" width="300" height="44" rx="3"/>
|
||||
<text class="t-mono mid" x="270" y="418">rot13/outbox/*.msg</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="6" data-flow-to="mediator2" d="M270,434 V460" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="watch3" x="286" y="452">{{watch3}}</text>
|
||||
|
||||
<!-- 7. second mediator process (terminal 4) ========================== -->
|
||||
<g class="node" data-flow-node="mediator2">
|
||||
<rect class="box-accent" x="120" y="462" width="300" height="46" rx="3"/>
|
||||
<text class="t-lead mid" data-label="mediator2" x="270" y="484">{{mediator2}}</text>
|
||||
<text class="t-mut mid" data-label="t4" x="270" y="500">{{t4}}</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="7" data-flow-to="inbox3" d="M270,508 V534" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="publish4" x="286" y="526">{{publish4}}</text>
|
||||
|
||||
<!-- 8. consoleOut/inbox ============================================== -->
|
||||
<g class="node" data-flow-node="inbox3">
|
||||
<rect class="box-plain" x="120" y="536" width="300" height="44" rx="3"/>
|
||||
<text class="t-mono mid" x="270" y="564">consoleOut/inbox/*.msg</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="8" data-flow-to="actuator" d="M270,580 V606" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="watch4" x="286" y="598">{{watch4}}</text>
|
||||
|
||||
<!-- 9. ActuatorService (terminal 5) ================================== -->
|
||||
<g class="node" data-flow-node="actuator">
|
||||
<rect class="box" x="120" y="608" width="300" height="46" rx="3"/>
|
||||
<text class="t-lead mid" data-label="actuator" x="270" y="630">{{actuator}}</text>
|
||||
<text class="t-mut mid" data-label="t5" x="270" y="646">{{t5}}</text>
|
||||
</g>
|
||||
|
||||
<!-- the four directories belong to one message board on one filesystem -->
|
||||
<path class="edge-dash" d="M436,98 H452 V580 H436"/>
|
||||
<text class="t-mono" x="460" y="330">messageBoard/</text>
|
||||
<text class="t-mut" data-label="board" x="460" y="348">{{board}}</text>
|
||||
|
||||
<!-- the five processes are started by hand, one terminal each -->
|
||||
<path class="edge-dash" d="M104,24 H88 V654 H104"/>
|
||||
<text class="t-warn" data-label="topology" x="14" y="686">{{topology}}</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 5.2 KiB |
@@ -0,0 +1,91 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 560 700" width="560" height="700"
|
||||
role="img" aria-labelledby="mj-title">
|
||||
<title id="mj-title">{{alt}}</title>
|
||||
<style><!--CSS--></style>
|
||||
|
||||
<defs>
|
||||
<marker id="a" viewBox="0 0 10 10" refX="9" refY="5"
|
||||
markerWidth="6.5" markerHeight="6.5" orient="auto-start-reverse">
|
||||
<path class="arrow" d="M0,0 L10,5 L0,10 z"/>
|
||||
</marker>
|
||||
</defs>
|
||||
|
||||
<!-- one JVM, five virtual threads: the frame the whole chain lives in -->
|
||||
<rect class="box-plain" x="10" y="10" width="540" height="676" rx="4"/>
|
||||
<text class="t-mut" data-label="frame" x="22" y="30">{{frame}}</text>
|
||||
|
||||
<!-- 1. ConsoleIn ==================================================== -->
|
||||
<g class="node" data-flow-node="consolein">
|
||||
<rect class="box" x="120" y="44" width="300" height="44" rx="3"/>
|
||||
<text class="t-lead mid" data-label="consolein" x="270" y="72">{{consolein}}</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="1" data-flow-to="outbox1" d="M270,88 V114" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="put1" x="286" y="106">{{put1}}</text>
|
||||
|
||||
<!-- 2. consoleIn.outbox ============================================= -->
|
||||
<g class="node" data-flow-node="outbox1">
|
||||
<rect class="box-plain" x="120" y="116" width="300" height="44" rx="3"/>
|
||||
<text class="t-mono mid" x="270" y="144">consoleIn.outbox</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="2" data-flow-to="mediator1" d="M270,160 V186" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="take1" x="286" y="178">{{take1}}</text>
|
||||
|
||||
<!-- 3. first mediator =============================================== -->
|
||||
<g class="node" data-flow-node="mediator1">
|
||||
<rect class="box-accent" x="120" y="188" width="300" height="44" rx="3"/>
|
||||
<text class="t-lead mid" data-label="mediator1" x="270" y="211">{{mediator1}}</text>
|
||||
<text class="t-mut mid" data-label="route1" x="270" y="226">{{route1}}</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="3" data-flow-to="inbox2" d="M270,232 V258" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="put2" x="286" y="250">{{put2}}</text>
|
||||
|
||||
<!-- 4. rot13.inbox =================================================== -->
|
||||
<g class="node" data-flow-node="inbox2">
|
||||
<rect class="box-plain" x="120" y="260" width="300" height="44" rx="3"/>
|
||||
<text class="t-mono mid" x="270" y="288">rot13.inbox</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="4" data-flow-to="rot13" d="M270,304 V330" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="take2" x="286" y="322">{{take2}}</text>
|
||||
|
||||
<!-- 5. ROT13 ========================================================= -->
|
||||
<g class="node" data-flow-node="rot13">
|
||||
<rect class="box" x="120" y="332" width="300" height="44" rx="3"/>
|
||||
<text class="t-lead mid" data-label="rot13" x="270" y="360">{{rot13}}</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="5" data-flow-to="outbox2" d="M270,376 V402" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="put3" x="286" y="394">{{put3}}</text>
|
||||
|
||||
<!-- 6. rot13.outbox ================================================== -->
|
||||
<g class="node" data-flow-node="outbox2">
|
||||
<rect class="box-plain" x="120" y="404" width="300" height="44" rx="3"/>
|
||||
<text class="t-mono mid" x="270" y="432">rot13.outbox</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="6" data-flow-to="mediator2" d="M270,448 V474" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="take3" x="286" y="466">{{take3}}</text>
|
||||
|
||||
<!-- 7. second mediator =============================================== -->
|
||||
<g class="node" data-flow-node="mediator2">
|
||||
<rect class="box-accent" x="120" y="476" width="300" height="44" rx="3"/>
|
||||
<text class="t-lead mid" data-label="mediator2" x="270" y="499">{{mediator2}}</text>
|
||||
<text class="t-mut mid" data-label="route2" x="270" y="514">{{route2}}</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="7" data-flow-to="inbox3" d="M270,520 V546" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="put4" x="286" y="538">{{put4}}</text>
|
||||
|
||||
<!-- 8. consoleOut.inbox ============================================== -->
|
||||
<g class="node" data-flow-node="inbox3">
|
||||
<rect class="box-plain" x="120" y="548" width="300" height="44" rx="3"/>
|
||||
<text class="t-mono mid" x="270" y="576">consoleOut.inbox</text>
|
||||
</g>
|
||||
<path class="edge" data-flow="8" data-flow-to="consoleout" d="M270,592 V618" marker-end="url(#a)"/>
|
||||
<text class="t-accent" data-label="take4" x="286" y="610">{{take4}}</text>
|
||||
|
||||
<!-- 9. ConsoleOut ==================================================== -->
|
||||
<g class="node" data-flow-node="consoleout">
|
||||
<rect class="box" x="120" y="620" width="300" height="44" rx="3"/>
|
||||
<text class="t-lead mid" data-label="consoleout" x="270" y="648">{{consoleout}}</text>
|
||||
</g>
|
||||
|
||||
<!-- side note: who holds the topology -->
|
||||
<text class="t-warn" data-label="topology" x="22" y="672">{{topology}}</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.8 KiB |