C4 model introduce

how to use

install java

install graphviz

brew install graphviz

install vscode plugin PlantUML

https://marketplace.visualstudio.com/items?itemName=jebbs.plantumlarrow-up-right

create diagram

https://github.com/plantuml-stdlib/C4-PlantUMLarrow-up-right

@startuml C4_Elements
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml

Person(personAlias, "Label", "Optional Description")
Container(containerAlias, "Label", "Technology", "Optional Description")
System(systemAlias, "Label", "Optional Description")

Rel(personAlias, containerAlias, "Label", "Optional Technology")
@enduml

이런 그림이 λ‚˜μ˜¨λ‹€.

code snippet

https://github.com/plantuml-stdlib/C4-PlantUML/blob/master/.vscode/C4.code-snippetsarrow-up-right

이걸 λ‹€μš΄λ°›μ•„μ„œ vscode에 μ—°κ²°ν•΄μ€€λ‹€.

λ‚˜λŠ” ν˜„μž¬ ν”„λ‘œμ νŠΈμ—λ§Œ μ‚¬μš©ν•˜λ €κ³  .vscode/C4.code-snippets에 λ„£μ–΄μ£Όμ—ˆλ‹€.

κ°œλ…

https://modeling.com/arrow-up-right

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/arrow-up-right μ—¬κΈ°μ„œ ν•΄λ³Όμˆ˜ μžˆλ‹€. μ•„λž˜μ—μ„œ μ„€λͺ…

abstractions first, notation second

첫 λ²ˆμ§ΈλŠ” 좔상화

두 λ²ˆμ§Έκ°€ ν‘œκΈ°λ²•

ensure that your team has a ubiqutous language to describe software architecture

νŒ€μ΄ μ†Œν”„νŠΈμ›¨μ–΄ μ•„ν‚€ν…μ²˜λ₯Ό μ„€λͺ…ν•˜λŠ” μœ λΉ„μΏΌν„°μŠ€ μ–Έμ–΄λ₯Ό κ°€μ§€κ³  μžˆλŠ”μ§€ ν™•μΈν•˜μ‹­μ‹œμ˜€.

μœ λΉ„μΏΌν„°μŠ€ μ»΄ν“¨νŒ…μ΄λž€ '(신은)μ–΄λ””μ—λ‚˜ 널리 μ‘΄μž¬ν•œλ‹€'λŠ” 라틴어 ubiquitarius의 μ˜μ–΄μ‹ λ³€ν˜• 'Ubiquitous'와 μ»΄ν“¨νŒ…μ΄ κ²°ν•©λœ λ‹¨μ–΄λ‘œ 'μ–Έμ œ μ–΄λ””μ„œλ“  μ–΄λ–€ κΈ°κΈ°λ₯Ό ν†΅ν•΄μ„œλ„ μ»΄ν“¨νŒ…ν•  수 μžˆλŠ” 것'을 μ˜λ―Έν•œλ‹€.

review

General

λ„ν‘œμ— 제λͺ©μ΄ μžˆμŠ΅λ‹ˆκΉŒ?

λ‹€μ΄μ–΄κ·Έλž¨ μœ ν˜•μ΄ 무엇인지 μ΄ν•΄ν•©λ‹ˆκΉŒ?

λ‹€μ΄μ–΄κ·Έλž¨ λ²”μœ„κ°€ 무엇인지 μ΄ν•΄ν•©λ‹ˆκΉŒ?

λ‹€μ΄μ–΄κ·Έλž¨μ— ν‚€/λ²”λ‘€κ°€ μžˆμŠ΅λ‹ˆκΉŒ?

Elements

λͺ¨λ“  μš”μ†Œμ— 이름이 μžˆμŠ΅λ‹ˆκΉŒ?

λͺ¨λ“  μš”μ†Œμ˜ μœ ν˜•μ„ μ΄ν•΄ν•©λ‹ˆκΉŒ? (예: 좔상화 μˆ˜μ€€, 예: μ†Œν”„νŠΈμ›¨μ–΄ μ‹œμŠ€ν…œ, μ»¨ν…Œμ΄λ„ˆ λ“±)

λͺ¨λ“  μš”μ†Œκ°€ 무엇을 ν•˜λŠ”μ§€ μ΄ν•΄ν•©λ‹ˆκΉŒ?

ν•΄λ‹Ήλ˜λŠ” 경우 λͺ¨λ“  μš”μ†Œμ™€ κ΄€λ ¨λœ 기술 선택 사항을 μ΄ν•΄ν•˜κ³  μžˆμŠ΅λ‹ˆκΉŒ?

μ‚¬μš©λœ λͺ¨λ“  약어와 μ•½μ–΄μ˜ 의미λ₯Ό μ΄ν•΄ν•©λ‹ˆκΉŒ?

μ‚¬μš©λœ λͺ¨λ“  μƒ‰μƒμ˜ 의미λ₯Ό μ΄ν•΄ν•©λ‹ˆκΉŒ?

μ‚¬μš©λœ λͺ¨λ“  λͺ¨μ–‘μ˜ 의미λ₯Ό μ΄ν•΄ν•©λ‹ˆκΉŒ?

μ‚¬μš©λœ λͺ¨λ“  μ•„μ΄μ½˜μ˜ 의미λ₯Ό μ΄ν•΄ν•©λ‹ˆκΉŒ?

μ‚¬μš©λœ λͺ¨λ“  ν…Œλ‘λ¦¬ μŠ€νƒ€μΌμ˜ 의미λ₯Ό μ΄ν•΄ν•˜κ³  μžˆμŠ΅λ‹ˆκΉŒ? (예: μ‹€μ„ , 점선 λ“±)

μ‚¬μš©λœ λͺ¨λ“  μš”μ†Œ 크기의 의미λ₯Ό μ΄ν•΄ν•©λ‹ˆκΉŒ? (예: μž‘μ€ μƒμžμ™€ 큰 μƒμž)

관계

λͺ¨λ“  행에 ν•΄λ‹Ή κ΄€κ³„μ˜ μ˜λ„λ₯Ό μ„€λͺ…ν•˜λŠ” λ ˆμ΄λΈ”μ΄ μžˆμŠ΅λ‹ˆκΉŒ?

ν•΄λ‹Ήλ˜λŠ” 경우 λͺ¨λ“  관계와 κ΄€λ ¨λœ 기술 선택을 μ΄ν•΄ν•˜κ³  μžˆμŠ΅λ‹ˆκΉŒ? (예: ν”„λ‘œμ„ΈμŠ€ κ°„ 톡신을 μœ„ν•œ ν”„λ‘œν† μ½œ)

μ‚¬μš©λœ λͺ¨λ“  약어와 μ•½μ–΄μ˜ 의미λ₯Ό μ΄ν•΄ν•©λ‹ˆκΉŒ?

μ‚¬μš©λœ λͺ¨λ“  μƒ‰μƒμ˜ 의미λ₯Ό μ΄ν•΄ν•©λ‹ˆκΉŒ?

μ‚¬μš©λœ λͺ¨λ“  ν™”μ‚΄μ΄‰μ˜ 의미λ₯Ό μ΄ν•΄ν•©λ‹ˆκΉŒ?

μ‚¬μš©λœ λͺ¨λ“  μ„  μŠ€νƒ€μΌμ˜ 의미λ₯Ό μ΄ν•΄ν•©λ‹ˆκΉŒ? (예: μ‹€μ„ , 점선 λ“±)

Last updated