66 lines
4.6 KiB
XML
66 lines
4.6 KiB
XML
<svg xmlns="http://www.w3.org/2000/svg" width="1040" height="720" viewBox="0 0 1040 720" font-family="Pretendard, Helvetica, Arial, sans-serif">
|
|
<defs>
|
|
<marker id="arrowBlue" markerWidth="10" markerHeight="10" refX="7" refY="5" orient="auto" markerUnits="userSpaceOnUse">
|
|
<path d="M0,0 L8,5 L0,10 z" fill="#1F6FEB"/>
|
|
</marker>
|
|
<marker id="arrowGray" markerWidth="10" markerHeight="10" refX="7" refY="5" orient="auto" markerUnits="userSpaceOnUse">
|
|
<path d="M0,0 L8,5 L0,10 z" fill="#57606A"/>
|
|
</marker>
|
|
</defs>
|
|
<rect x="0" y="0" width="1040" height="720" fill="#FFFFFF"/>
|
|
|
|
<text x="40" y="42" font-size="20" font-weight="bold" fill="#1F2937">Hexagonal (Ports & Adapters) — 도메인을 바깥에서 격리한다</text>
|
|
<text x="40" y="66" font-size="12" fill="#6B7280">모든 adapter가 core에 의존(안쪽). core는 port(interface)만 정의하고 외부(web·DB)를 모른다.</text>
|
|
|
|
<!-- Application Core (hexagon) -->
|
|
<polygon points="410,345 450,270 610,270 650,345 610,420 450,420" fill="#EFF6FF" stroke="#1F6FEB" stroke-width="2.5"/>
|
|
<text x="530" y="340" text-anchor="middle" font-size="13" font-weight="bold" fill="#1F6FEB">Application Core</text>
|
|
<text x="530" y="360" text-anchor="middle" font-size="12" fill="#1F6FEB">domain + use case</text>
|
|
|
|
<!-- Web Adapter (inbound) -->
|
|
<rect x="80" y="230" width="200" height="70" fill="#FFFFFF" stroke="#57606A" stroke-width="1.5"/>
|
|
<text x="180" y="260" text-anchor="middle" font-size="12" font-weight="bold" fill="#24292F">Web Adapter</text>
|
|
<text x="180" y="280" text-anchor="middle" font-size="12" fill="#24292F">REST · inbound</text>
|
|
|
|
<!-- Test / Batch (inbound) -->
|
|
<rect x="80" y="390" width="200" height="70" fill="#FFFFFF" stroke="#57606A" stroke-width="1.5"/>
|
|
<text x="180" y="420" text-anchor="middle" font-size="12" font-weight="bold" fill="#24292F">Test / Batch</text>
|
|
<text x="180" y="440" text-anchor="middle" font-size="12" fill="#24292F">inbound</text>
|
|
|
|
<!-- Persistence Adapter (outbound) -->
|
|
<rect x="780" y="230" width="200" height="70" fill="#FFFFFF" stroke="#57606A" stroke-width="1.5"/>
|
|
<text x="880" y="260" text-anchor="middle" font-size="12" font-weight="bold" fill="#24292F">Persistence Adapter</text>
|
|
<text x="880" y="280" text-anchor="middle" font-size="12" fill="#24292F">JPA · outbound</text>
|
|
|
|
<!-- DB cylinder -->
|
|
<path d="M820,412 L820,470 A60,10 0 0 0 940,470 L940,412" fill="#FFFFFF" stroke="#57606A" stroke-width="1.5"/>
|
|
<ellipse cx="880" cy="412" rx="60" ry="10" fill="#FFFFFF" stroke="#57606A" stroke-width="1.5"/>
|
|
<text x="880" y="448" text-anchor="middle" font-size="12" font-weight="bold" fill="#24292F">DB</text>
|
|
|
|
<!-- Edges: adapters -> core (inward, blue) -->
|
|
<line x1="280" y1="265" x2="444" y2="306" stroke="#1F6FEB" stroke-width="2.5" marker-end="url(#arrowBlue)"/>
|
|
<text x="352" y="276" font-size="11" fill="#1F6FEB">inbound port</text>
|
|
<line x1="280" y1="425" x2="446" y2="386" stroke="#1F6FEB" stroke-width="2.5" marker-end="url(#arrowBlue)"/>
|
|
<text x="352" y="420" font-size="11" fill="#1F6FEB">inbound port</text>
|
|
<line x1="780" y1="265" x2="616" y2="306" stroke="#1F6FEB" stroke-width="2.5" marker-end="url(#arrowBlue)"/>
|
|
<text x="648" y="276" font-size="11" fill="#1F6FEB">outbound port 구현</text>
|
|
|
|
<!-- Edge: persistence -> DB (gray) -->
|
|
<line x1="880" y1="300" x2="880" y2="410" stroke="#57606A" stroke-width="1.5" marker-end="url(#arrowGray)"/>
|
|
<text x="890" y="360" font-size="11" fill="#6B7280">JDBC</text>
|
|
|
|
<!-- Callout (key insight) -->
|
|
<rect x="340" y="500" width="560" height="120" rx="8" fill="#F6F8FA" stroke="#57606A" stroke-width="1.5"/>
|
|
<text x="356" y="526" font-size="12" font-weight="bold" fill="#374151">핵심 — 의존성 역전(DIP)</text>
|
|
<text x="356" y="552" font-size="11" fill="#374151">• core 는 port(interface)만 정의, 구현은 바깥 adapter 가 담당</text>
|
|
<text x="356" y="574" font-size="11" fill="#374151">• 그래서 core(도메인)는 web·DB 의 존재를 모른다</text>
|
|
<text x="356" y="596" font-size="11" fill="#374151">• DB·web 교체 자유 + 실제 장비 없이 격리 테스트 가능</text>
|
|
<text x="356" y="618" font-size="11" fill="#374151">• 대가: port/adapter 보일러플레이트, 모델 매핑 비용</text>
|
|
|
|
<!-- Legend -->
|
|
<text x="60" y="516" font-size="11" fill="#1F6FEB">⬡ 파란 육각형 = Application Core (격리 대상)</text>
|
|
<text x="60" y="538" font-size="11" fill="#1F6FEB">→ 파란 화살 = adapter → core 의존(안쪽)</text>
|
|
|
|
<text x="1000" y="690" text-anchor="end" font-size="10" font-style="italic" fill="#9CA3AF">v1 · 2026-07-04</text>
|
|
</svg>
|