# Swift Design Pattern 讀書會
---
### Chapter 2: How to Read a Class Diagram
---
開始之前...
---
分享:
你的開發流程是怎樣?
從拿到需求到 deploy 的過程
---
上集提要:
Design patterns aren’t concrete implementations, but rather, they are a starting point for writing code.
---
什麼是 class diagram ?
- UML 一種
- 描述類別之間的關係
---
## 為什麼要用 UML?
---
為什麼要用 UML?
我的想法:
自然語言很囉唆 + 容易引起歧義
UML 一目瞭然
---
類別之間的關係可以有什麼關係?
1. ia-a
2. has-a
- association 結合 (has-a)
- aggregation 聚合 / composition 組合 (contains-a)
3. implementation
4. dependency
---
## 1. ia-a

---

---
## 2. has-a (association)

---


---
## 3. implementation

---

---
## 4. dependency

---

---
## UML Generator
APP:
https://www.visual-paradigm.com/tw/download/community.jsp
線上:
https://online.visual-paradigm.com/tw/
---
End
---
{"metaMigratedAt":"2023-06-14T23:28:06.134Z","metaMigratedFrom":"YAML","title":"How to Read a Class Diagram","breaks":true,"description":"2019/08/18","contributors":"[{\"id\":\"c23c28cc-0f80-4485-ad9a-b8afa43619b9\",\"add\":3484,\"del\":2240}]"}