C4 model introduce
how to use
install java
install graphviz
install vscode plugin PlantUML
https://marketplace.visualstudio.com/items?itemName=jebbs.plantuml
create diagram
https://github.com/plantuml-stdlib/C4-PlantUML
์ด๋ฐ ๊ทธ๋ฆผ์ด ๋์จ๋ค.
code snippet
https://github.com/plantuml-stdlib/C4-PlantUML/blob/master/.vscode/C4.code-snippets
์ด๊ฑธ ๋ค์ด๋ฐ์์ vscode์ ์ฐ๊ฒฐํด์ค๋ค.
๋๋ ํ์ฌ ํ๋ก์ ํธ์๋ง ์ฌ์ฉํ๋ ค๊ณ .vscode/C4.code-snippets์ ๋ฃ์ด์ฃผ์๋ค.
๊ฐ๋
4๊ฐ์ง ๊ด์ ์ ๊ทธ๋ฆผ์ด ์๋ค.
System Context
Container
Component
Code
Level
์๋ก ๋ค๋ฅธ ๊ด์ฌ์ ๊ฐ์ง ๋ค์ด์ด๊ทธ๋จ ๋ฐ ๋ฌธ์์ ๋ํ ๋ค์ํ ์ฒญ์ค์ด ์์ต๋๋ค.
์ํํธ์จ์ด ์ํคํ ์ฒ ๋ค์ด์ด๊ทธ๋จ์ ๊ทธ๋ฆด ๋ ์ํํธ์จ์ด ๊ฐ๋ฐ์์ฒ๋ผ ์๊ฐํ์ญ์์ค.
๊ณตํต๋ ์ถ์ํ ์งํฉ์ด ๊ณตํต ํ๊ธฐ๋ฒ๋ณด๋ค ๋ ์ค์ํฉ๋๋ค.
์ํํธ์จ์ด ์์คํ ์ ํ๋ ์ด์์ ์ฝ๋ ์์์ ์ํด ์ฐจ๋ก๋ก ๊ตฌํ๋๋ ํ๋ ์ด์์ ๊ตฌ์ฑ ์์๋ฅผ ๊ฐ๊ฐ ํฌํจํ๋ ํ๋ ์ด์์ ์ปจํ ์ด๋๋ก ๊ตฌ์ฑ๋ฉ๋๋ค.
Level 1: System Context Diagram
A System Context diagram provides a starting point, showing how the software system in scope fits into the world around it.
System Context diagram์ ๋ฒ์์ ์ํํธ์จ์ด ์์คํ ์ด ์ฃผ๋ณ ์ธ๊ณ์ ์ด๋ป๊ฒ ๋ง๋์ง ๋ณด์ฌ์ฃผ๋ ์์์ ์ ์ ๊ณตํฉ๋๋ค.
Level 2: Container Diagram
A Container diagram zooms into the software system in scope, showing the high-level technical building blocks.
Container diagram์ ๋ฒ์ ๋ด์์ ์ํํธ์จ์ด ์์คํ ์ ํ๋ํ์ฌ ๋์ ์์ค์ ๊ธฐ์ ๊ตฌ์ฑ ์์๋ฅผ ๋ณด์ฌ์ค๋๋ค.
Level 3: Component Diagram
A Component diagram zooms into an individual container, showing the components inside it.
Component diagram์ ๊ฐ๋ณ ์ปจํ ์ด๋๋ฅผ ํ๋ํ์ฌ ๊ทธ ์์ ๊ตฌ์ฑ ์์๋ฅผ ํ์ํฉ๋๋ค.
Level 4: Code Diagram
A code (e.g. UML class) diagram can be used to zoom into an individual component, showing how that component is implemented.
code diagram์ ์ฌ์ฉํ์ฌ ๊ฐ๋ณ ๊ตฌ์ฑ ์์๋ฅผ ํ๋ํ์ฌ ํด๋น ๊ตฌ์ฑ ์์๊ฐ ๊ตฌํ๋๋ ๋ฐฉ๋ฒ์ ํ์ํ ์ ์์ต๋๋ค.
๊ทธ๋ฆฌ๊ธฐ๋ฅผ ์ถ์ฒํ์ง ์์ผ๋ฉฐ ์๋์ผ๋ก ์ฝ๋์์ ์์ฑํ๋๊ฑธ ์ถ์ฒํฉ๋๋ค.
misc
titles
short and meaningful, include the diagram type, numbered if diaram order is important; for example:
์งง๊ณ ์๋ฏธ ์๋ ๋ค์ด์ด๊ทธ๋จ ์ ํ์ ํฌํจ ์๋ฅผ ๋ค์ด:
๋ค์ด์ด๊ทธ๋จ ์์๊ฐ ์ค์ํ ๊ฒฝ์ฐ ๋ฒํธ๊ฐ ๋งค๊ฒจ์ง๋๋ค.
layout
sticky notes and indexs card( e.g crc cards) make a great substitute for hand-drawn boxes, especially if you dont have a whiteboard
์คํฐ์ปค ๋ฉ๋ชจ ๋ฐ ์์ธ ์นด๋(์: crc ์นด๋)๊ฐ ์์ผ๋ก ๊ทธ๋ฆฐ ์์๋ฅผ ๋์ ํ ์ ์์ต๋๋ค.
visual consistency
try to be consistent with notation and element positioning across diagrams
๋ค์ด์ด๊ทธ๋จ ์ ์ฒด์์ ํ๊ธฐ๋ฒ ๋ฐ ์์ ์์น์ ์ผ๊ด์ฑ์ ์ ์งํ์ญ์์ค.
acronyms(์ค์๋ง)
๋งค์ฐ ์ฃผ์ํ์.
be ware of using acronyms, especially those related to the business/domain that you work in
ํนํ ๋น์ ์ด ์ผํ๋ ๋น์ฆ๋์ค/๋๋ฉ์ธ๊ณผ ๊ด๋ จ๋ ์ค์๋ง์ ์ฌ์ฉํ์ญ์์. ์๋ก ์กฐ์ธํ๋ ์ฌ๋์ ๋ฐ๋ก ์ดํดํ ์ ์์ต๋๋ค.
element
start with simple boxes containing the element name, type, technology (if appropriate) and a description/responsibilities
์์ ์ด๋ฆ, ์ ํ, ๊ธฐ์ (ํด๋น๋๋ ๊ฒฝ์ฐ) ๋ฐ ์ค๋ช /์ฑ ์์ด ํฌํจ๋ ๊ฐ๋จํ ์์๋ก ์์ํฉ๋๋ค.
๋ฐ์ค๋ค ํ์
์ผ์ชฝ์ฒ๋ผํ์ง๋ง๊ณ ์ค๋ฅธ์ชฝ์ฒ๋ผ ์์ธํ ๋ด์ฉ์ ๋ค์ด์ด๊ทธ๋จ์ ์ฐ์.
lines
favour uni-directional lines showing the most important dependencies or data flow with an annotation to be explicit about the purpose of the lines and direction
๊ฐ์ฅ ์ค์ํ ์ข ์์ฑ ๋๋ ๋ฐ์ดํฐ ํ๋ฆ์ ๋ณด์ฌ์ฃผ๋ ๋จ๋ฐฉํฅ ๋ผ์ธ์ ์ ํธํ๋ฉฐ ๋ผ์ธ๊ณผ ๋ฐฉํฅ์ ๋ชฉ์ ์ ๋ช ์ํ๋ ์ฃผ์์ ์ฌ์ฉํฉ๋๋ค.
summarise the intent of the relationship
๊ด๊ณ์ ์๋ ์์ฝ
summarise, yet be specific
์์ฝํ๋ ๊ตฌ์ฒด์ ์ผ๋ก
show both directions when the intents are differnt
์๋๊ฐ ๋ค๋ฅธ ๊ฒฝ์ฐ ์๋ฐฉํฅ ํ์
beware of hiding the true story
์ด๋ฐ๊ทธ๋ฆผ์ด๋ฉด ๋ง๋ ๋ด์ฉ์ด๊ธฐ๋ ํ๋ ์ค์ํ ๋ด์ฉ์ ์จ๊ธธ์ ์์ต๋๋ค.
์ด๋ ๊ฒ ๊ทธ๋ฆฌ๋ฉด ์ข๋ ๋ช ํํด์ง๋๋ค.
add more word to make the intent explicit
์์ฝ์ ๋ ๋ง์ ๋จ์ด๋ก ํํํ์ญ์์ค.
key and legend
explain shapes, line styles, colours, borders, acronyms , etc even if you notations seems obvious
ํ๊ธฐ๋ฒ์ด ๋ถ๋ช ํด ๋ณด์ด๋๋ผ๋ ๋ชจ์, ์ ์คํ์ผ, ์์, ํ ๋๋ฆฌ, ์ฝ์ด ๋ฑ์ ์ค๋ช ํ์ญ์์ค.
๋๊ธฐ ์ค์ ๋น๋๊ธฐ๋ ์ ์ ๋ฑ์ผ๋ก ํ ์ ์์ต๋๋ค. ์ปฌ๋ฌ๋ ์๋งน์ ๊ณ ๋ คํ๊ธฐ ๋ฐ๋๋๋ค.
use shape,colour and size to complement a diagram the already make sense
์ด๋ฏธ ์๋ฏธ๊ฐ ์๋ ๋ค์ด์ด๊ทธ๋จ์ ๋ณด์ํ๊ธฐ ์ํด ๋ชจ์, ์์ ๋ฐ ํฌ๊ธฐ๋ฅผ ์ฌ์ฉํฉ๋๋ค.
icon
use icons to supplement text, not replace it
์์ด์ฝ์ ์ฌ์ฉํ์ฌ ํ ์คํธ๋ฅผ ๋์ฒดํ์ง ์๊ณ ๋ณด์ถฉํ์ญ์์ค.
increase the readability of software architecture diagrams, so they can stand alone
์ํํธ์จ์ด ์ํคํ ์ฒ ๋ค์ด์ด๊ทธ๋จ์ ๊ฐ๋ ์ฑ์ ๋์ฌ ๋ ๋ฆฝ์ ์ผ๋ก ์ฌ์ฉํ ์ ์์ต๋๋ค.
์์ด์ฝ์ ์ถ๊ฐํ์ฌ ์ดํด๋ฅผ ๋์ธ์ ์์ต๋๋ค.
any narrative should complement the diagram rather than explain it
์ด๋ค ๋ณด์ถฉ ๋ฌธ์๋ ๋ค์ด์ด๊ทธ๋จ์ ์ค๋ช ํ๊ธฐ๋ณด๋ค ๋ณด์ํด์ผ ํฉ๋๋ค.
notation check list
https://modeling.com/review/ ์ฌ๊ธฐ์ ํด๋ณผ์ ์๋ค. ์๋์์ ์ค๋ช
abstractions first, notation second
์ฒซ ๋ฒ์งธ๋ ์ถ์ํ
๋ ๋ฒ์งธ๊ฐ ํ๊ธฐ๋ฒ
ensure that your team has a ubiqutous language to describe software architecture
ํ์ด ์ํํธ์จ์ด ์ํคํ ์ฒ๋ฅผ ์ค๋ช ํ๋ ์ ๋น์ฟผํฐ์ค ์ธ์ด๋ฅผ ๊ฐ์ง๊ณ ์๋์ง ํ์ธํ์ญ์์ค.
์ ๋น์ฟผํฐ์ค ์ปดํจํ ์ด๋ '(์ ์)์ด๋์๋ ๋๋ฆฌ ์กด์ฌํ๋ค'๋ ๋ผํด์ด ubiquitarius์ ์์ด์ ๋ณํ 'Ubiquitous'์ ์ปดํจํ ์ด ๊ฒฐํฉ๋ ๋จ์ด๋ก '์ธ์ ์ด๋์๋ ์ด๋ค ๊ธฐ๊ธฐ๋ฅผ ํตํด์๋ ์ปดํจํ ํ ์ ์๋ ๊ฒ'์ ์๋ฏธํ๋ค.
review
General
๋ํ์ ์ ๋ชฉ์ด ์์ต๋๊น?
๋ค์ด์ด๊ทธ๋จ ์ ํ์ด ๋ฌด์์ธ์ง ์ดํดํฉ๋๊น?
๋ค์ด์ด๊ทธ๋จ ๋ฒ์๊ฐ ๋ฌด์์ธ์ง ์ดํดํฉ๋๊น?
๋ค์ด์ด๊ทธ๋จ์ ํค/๋ฒ๋ก๊ฐ ์์ต๋๊น?
Elements
๋ชจ๋ ์์์ ์ด๋ฆ์ด ์์ต๋๊น?
๋ชจ๋ ์์์ ์ ํ์ ์ดํดํฉ๋๊น? (์: ์ถ์ํ ์์ค, ์: ์ํํธ์จ์ด ์์คํ , ์ปจํ ์ด๋ ๋ฑ)
๋ชจ๋ ์์๊ฐ ๋ฌด์์ ํ๋์ง ์ดํดํฉ๋๊น?
ํด๋น๋๋ ๊ฒฝ์ฐ ๋ชจ๋ ์์์ ๊ด๋ จ๋ ๊ธฐ์ ์ ํ ์ฌํญ์ ์ดํดํ๊ณ ์์ต๋๊น?
์ฌ์ฉ๋ ๋ชจ๋ ์ฝ์ด์ ์ฝ์ด์ ์๋ฏธ๋ฅผ ์ดํดํฉ๋๊น?
์ฌ์ฉ๋ ๋ชจ๋ ์์์ ์๋ฏธ๋ฅผ ์ดํดํฉ๋๊น?
์ฌ์ฉ๋ ๋ชจ๋ ๋ชจ์์ ์๋ฏธ๋ฅผ ์ดํดํฉ๋๊น?
์ฌ์ฉ๋ ๋ชจ๋ ์์ด์ฝ์ ์๋ฏธ๋ฅผ ์ดํดํฉ๋๊น?
์ฌ์ฉ๋ ๋ชจ๋ ํ ๋๋ฆฌ ์คํ์ผ์ ์๋ฏธ๋ฅผ ์ดํดํ๊ณ ์์ต๋๊น? (์: ์ค์ , ์ ์ ๋ฑ)
์ฌ์ฉ๋ ๋ชจ๋ ์์ ํฌ๊ธฐ์ ์๋ฏธ๋ฅผ ์ดํดํฉ๋๊น? (์: ์์ ์์์ ํฐ ์์)
๊ด๊ณ
๋ชจ๋ ํ์ ํด๋น ๊ด๊ณ์ ์๋๋ฅผ ์ค๋ช ํ๋ ๋ ์ด๋ธ์ด ์์ต๋๊น?
ํด๋น๋๋ ๊ฒฝ์ฐ ๋ชจ๋ ๊ด๊ณ์ ๊ด๋ จ๋ ๊ธฐ์ ์ ํ์ ์ดํดํ๊ณ ์์ต๋๊น? (์: ํ๋ก์ธ์ค ๊ฐ ํต์ ์ ์ํ ํ๋กํ ์ฝ)
์ฌ์ฉ๋ ๋ชจ๋ ์ฝ์ด์ ์ฝ์ด์ ์๋ฏธ๋ฅผ ์ดํดํฉ๋๊น?
์ฌ์ฉ๋ ๋ชจ๋ ์์์ ์๋ฏธ๋ฅผ ์ดํดํฉ๋๊น?
์ฌ์ฉ๋ ๋ชจ๋ ํ์ด์ด์ ์๋ฏธ๋ฅผ ์ดํดํฉ๋๊น?
์ฌ์ฉ๋ ๋ชจ๋ ์ ์คํ์ผ์ ์๋ฏธ๋ฅผ ์ดํดํฉ๋๊น? (์: ์ค์ , ์ ์ ๋ฑ)
Last updated
Was this helpful?