Files
harmony/docs/diagrams/score-ref-composition.svg
Jean-Gabriel Gill-Couture b63de408f1
All checks were successful
Run Check Script / check (pull_request) Successful in 1m55s
docs: Add code samples and diagrams to score ref docs
2026-07-15 18:33:41 -04:00

39 lines
2.6 KiB
XML

<svg xmlns="http://www.w3.org/2000/svg" width="1100" height="300" viewBox="0 0 1100 300" role="img" aria-labelledby="title desc">
<title id="title">A Score passes a typed Ref to a dependent Score</title>
<desc id="desc">SomeDbScore produces DbRef from desired state. AppScore accepts DbRef without depending on SomeDbScore.</desc>
<defs>
<marker id="arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="8" markerHeight="8" orient="auto">
<path d="M0 0 10 5 0 10z" fill="#0f766e"/>
</marker>
<style>
.sans { font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
.mono { font-family: "JetBrains Mono", Consolas, monospace; }
</style>
</defs>
<rect width="1100" height="300" fill="#ffffff"/>
<g class="sans">
<text x="40" y="52" fill="#0f172a" font-size="30" font-weight="750">Score → Ref → dependent Score</text>
<text x="40" y="80" fill="#64748b" font-size="17">The Ref is the complete relationship between otherwise independent components.</text>
<text x="55" y="128" fill="#64748b" font-size="12" font-weight="750">PRODUCER</text>
<rect x="40" y="140" width="255" height="90" rx="12" fill="#172554"/>
<text x="64" y="168" fill="#bfdbfe" font-size="12" font-weight="750" letter-spacing="1.4">SCORE</text>
<text x="64" y="201" fill="#ffffff" font-size="22" font-weight="700" class="mono">SomeDbScore</text>
<text x="64" y="221" fill="#bfdbfe" font-size="14">owns database behavior</text>
<path d="M295 185H390" fill="none" stroke="#0f766e" stroke-width="2.5"/>
<rect x="390" y="158" width="250" height="54" rx="27" fill="#f0fdfa" stroke="#0f766e" stroke-width="1.5"/>
<text x="515" y="180" text-anchor="middle" fill="#0f766e" font-size="11" font-weight="750" letter-spacing="1.2">REF TYPE</text>
<text x="515" y="200" text-anchor="middle" fill="#115e59" font-size="18" font-weight="700" class="mono">DbRef</text>
<path d="M640 185H735" fill="none" stroke="#0f766e" stroke-width="2.5" marker-end="url(#arrow)"/>
<text x="750" y="128" fill="#64748b" font-size="12" font-weight="750">CONSUMER</text>
<rect x="735" y="140" width="255" height="90" rx="12" fill="#172554"/>
<text x="759" y="168" fill="#bfdbfe" font-size="12" font-weight="750" letter-spacing="1.4">SCORE</text>
<text x="759" y="201" fill="#ffffff" font-size="22" font-weight="700" class="mono">AppScore</text>
<text x="759" y="221" fill="#bfdbfe" font-size="14">knows DbRef, not SomeDbScore</text>
<text x="40" y="270" fill="#64748b" font-size="14">Creating and passing DbRef performs no I/O and says nothing about readiness.</text>
</g>
</svg>