66 lines
4.0 KiB
XML
66 lines
4.0 KiB
XML
<svg xmlns="http://www.w3.org/2000/svg" width="720" height="1160" viewBox="0 0 720 1160" role="img" aria-labelledby="title desc">
|
|
<title id="title">Матрица совместимости схемы события</title>
|
|
<desc id="desc">Вертикальная схема показывает событие v1, v2 с добавочным необязательным полем и v3 с изменённой семантикой. Consumer v1 читает stable fields, consumer v2 умеет нормализовать отсутствие нового поля, v3 требует обновления договора.</desc>
|
|
<defs>
|
|
<marker id="arrow" markerWidth="12" markerHeight="12" refX="10" refY="6" orient="auto">
|
|
<path d="M0,0 L12,6 L0,12 Z" fill="#4bc0c8"/>
|
|
</marker>
|
|
<style>
|
|
.bg { fill: #0d1724; }
|
|
.event { fill: #163544; stroke: #4bc0c8; stroke-width: 2; }
|
|
.consumer { fill: #1b293d; stroke: #607d9a; stroke-width: 2; }
|
|
.blocked { fill: #3b3030; stroke: #e7aa55; stroke-width: 2; }
|
|
.line { stroke: #4bc0c8; stroke-width: 4; fill: none; marker-end: url(#arrow); }
|
|
.warnline { stroke: #e7aa55; stroke-width: 4; fill: none; marker-end: url(#arrow); }
|
|
.title { fill: #f3fbff; font: 32px Arial, sans-serif; font-weight: 700; }
|
|
.label { fill: #d9edf6; font: 24px Arial, sans-serif; font-weight: 700; }
|
|
.body { fill: #a8bed0; font: 21px Arial, sans-serif; }
|
|
.code { fill: #92e3e8; font: 22px "SFMono-Regular", Consolas, monospace; }
|
|
</style>
|
|
</defs>
|
|
<rect class="bg" width="720" height="1160" rx="28"/>
|
|
<text class="title" x="48" y="62">Схема меняется по парам</text>
|
|
<text class="body" x="48" y="96">writer event ↔ declared reader contract</text>
|
|
|
|
<rect class="event" x="48" y="140" width="286" height="202" rx="18"/>
|
|
<text class="label" x="76" y="180">Event schema v1</text>
|
|
<text class="code" x="76" y="222">orderId</text>
|
|
<text class="code" x="76" y="256">status</text>
|
|
<text class="body" x="76" y="300">старый writer</text>
|
|
|
|
<rect class="consumer" x="386" y="140" width="286" height="202" rx="18"/>
|
|
<text class="label" x="414" y="180">Consumer v1</text>
|
|
<text class="code" x="414" y="222">reads stable fields</text>
|
|
<text class="body" x="414" y="266">resultVersion .1</text>
|
|
<text class="body" x="414" y="300">v1 accepted</text>
|
|
<path class="line" d="M334 241 L374 241"/>
|
|
|
|
<rect class="event" x="48" y="438" width="286" height="238" rx="18"/>
|
|
<text class="label" x="76" y="478">Event schema v2</text>
|
|
<text class="code" x="76" y="520">orderId · status</text>
|
|
<text class="code" x="76" y="554">paymentReference?</text>
|
|
<text class="body" x="76" y="600">добавлено optional field</text>
|
|
<text class="body" x="76" y="632">stable meaning сохранён</text>
|
|
|
|
<rect class="consumer" x="386" y="414" width="286" height="128" rx="18"/>
|
|
<text class="label" x="414" y="454">Consumer v1</text>
|
|
<text class="body" x="414" y="490">игнорирует declared optional</text>
|
|
<text class="body" x="414" y="520">resultVersion .1</text>
|
|
<path class="line" d="M334 500 L374 478"/>
|
|
|
|
<rect class="consumer" x="386" y="570" width="286" height="154" rx="18"/>
|
|
<text class="label" x="414" y="610">Consumer v2</text>
|
|
<text class="body" x="414" y="648">читает поле или null</text>
|
|
<text class="body" x="414" y="680">resultVersion .2</text>
|
|
<path class="line" d="M334 592 L374 646"/>
|
|
|
|
<rect class="blocked" x="48" y="838" width="624" height="206" rx="18"/>
|
|
<text class="label" x="78" y="882">Event schema v3: semantic change</text>
|
|
<text class="code" x="78" y="926">state вместо status</text>
|
|
<text class="body" x="78" y="966">JSON может распарситься, но meaning не объявлен.</text>
|
|
<text class="label" x="78" y="1014">contract update required</text>
|
|
<path class="warnline" d="M360 724 L360 816"/>
|
|
|
|
<text class="body" x="48" y="1112">Compatible — свойство конкретной пары writer и reader.</text>
|
|
</svg>
|