Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
模組化的Swift架構(二) DDD速成
Search
Hai Feng Kao
June 23, 2022
Programming
0
890
模組化的Swift架構(二) DDD速成
2022/6/21 ios@Taipei分享
介紹Domain Driven Design
Hai Feng Kao
June 23, 2022
Tweet
Share
More Decks by Hai Feng Kao
See All by Hai Feng Kao
物件導向的文藝復興:用DCI重塑程式設計的藝術
haifengkao
0
150
模組化的Swift架構(一) Redux入門
haifengkao
0
150
日常生活中的腦殘
haifengkao
0
280
機器學習超入門
haifengkao
0
180
UICollectionView自動布局
haifengkao
1
460
宅宅設計入門2
haifengkao
2
310
宅宅設計入門
haifengkao
5
330
Other Decks in Programming
See All in Programming
Rで始めるML・LLM活用入門
wakamatsu_takumu
0
190
Java 21/25 Virtual Threads 소개
debop
0
230
Claude Code Skill入門
mayahoney
0
410
エンジニアの「手元の自動化」を加速するn8n 2026.02.27
symy2co
0
170
Kubernetesでセルフホストが簡単なNewSQLを求めて / Seeking a NewSQL Database That's Simple to Self-Host on Kubernetes
nnaka2992
0
170
Everything Claude Code OSS詳細 — 5層構造の中身と導入方法
targe
0
150
Ruby and LLM Ecosystem 2nd
koic
1
1.2k
安いハードウェアでVulkan
fadis
0
730
コーディングルールの鮮度を保ちたい / keep-fresh-go-internal-conventions
handlename
0
230
nuget-server - あなたが必要だったNuGetサーバー
kekyo
PRO
0
370
存在論的プログラミング: 時間と存在を記述する
koriym
3
340
Migration to Signals, Signal Forms, Resource API, and NgRx Signal Store @Angular Days 03/2026 Munich
manfredsteyer
PRO
0
130
Featured
See All Featured
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
360
Git: the NoSQL Database
bkeepers
PRO
432
67k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
Utilizing Notion as your number one productivity tool
mfonobong
4
270
GraphQLとの向き合い方2022年版
quramy
50
14k
A Tale of Four Properties
chriscoyier
163
24k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
180
sira's awesome portfolio website redesign presentation
elsirapls
0
200
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
570
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.3k
Chasing Engaging Ingredients in Design
codingconduct
0
150
Transcript
Domain Driven Design速成 Hai Feng Kao 2022/6/21 模組化的Swift架構(⼆)
Domain Driven Design • 以領域(domain)為核⼼的設計思維 • 常⾒的設計思維 • UI驅動 •
資料庫驅動 • API驅動 • 領域驅動 • 隕⽯驅動
開發流程
開發流程
• ⽤來設計電路的程式⼀定要有 • 電阻、電容、腳位 • 銀⾏轉帳程式⼀定要有 • 活儲帳⼾、定存帳⼾、⾦額 • 叫⾞app⼀定要有
• ⾞型、上⾞地點、路線、下⾞地 點 必也正名乎
六⾓形架構 https://vaadin.com/blog/ddd-part-3-domain-driven-design-and-the-hexagonal-architecture
領域模型 https://dotblogs.com.tw/regionbbs/2021/05/29/anemicdomainmodel
貧⾎模型 https://dotblogs.com.tw/regionbbs/2021/05/29/anemicdomainmodel
DDD的設計模式
https://speakerdeck.com/softleader/ru-he-jin-xing-dddshi-zuo-fe25e1b7-db0c-4d53-99b1-8ed9d1ca4837?slide=7
• 給backend⽤的 • 只有main thread DDD程式的運作流程 https://speakerdeck.com/softleader/ru-he-jin-xing-dddshi-zuo-fe25e1b7-db0c-4d53-99b1-8ed9d1ca4837?slide=12
• 收到Request • 從Respository取出物件 (Aggregate Root) • 呼叫物件的⽅法來處理資料 • 把處理完的資料(Aggregate
Root) 存回Repository Backend運作流程
• 收到Request • 從Respository取出物件 (Aggregate Root) • 呼叫物件的⽅法來處理資料 • 把處理完的資料(Aggregate
Root) 存回Repository Backend運作流程 • 使⽤者打開App • ⼿指點⼀點 • 呼叫物件的⽅法來更新畫⾯ • ⼿指滑⼀滑 • 呼叫物件的⽅法來更新畫⾯ App運作流程
• 收到Request • 從Respository取出物件 (Aggregate Root) • 呼叫物件的⽅法來處理資料 • 把處理完的資料(Aggregate
Root) 存回Repository Backend運作流程 • 使⽤者打開App • ⼿指點⼀點 • 呼叫物件的⽅法來更新畫⾯ • ⼿指滑⼀滑 • 呼叫物件的⽅法來更新畫⾯ App運作流程 狀態被完整地保存在Repository 狀態被保存在UIKit、SwiftUI、第三⽅套件、⾃⼰寫的物件
• 有領域 • 單機⼿遊 • 繪圖app、記事本、⾳樂播放軟體 • 沒有領域 • 呼叫API把傳回的資料呈現在畫⾯
上 • 所以的邏輯判斷都由backend負責 把DDD應⽤在App上
• 有領域 • 單機⼿遊 • 繪圖app、記事本、⾳樂播放軟體 • 沒有領域 • 呼叫API把傳回的資料呈現在畫⾯
上 • 所以的邏輯判斷都由backend負責 把DDD應⽤在App上 佔99.9% 0.1%
如何設計模組化的App架構? 把DDD應⽤在App設計 https://betterprogramming.pub/ios-app-modularisation-the-starting-point-1419db0474ed
模組之間如何溝通? 把DDD應⽤在App設計 https://betterprogramming.pub/ios-app-modularisation-the-starting-point-1419db0474ed
限界上下⽂
六⾓形架構 https://vaadin.com/blog/ddd-part-3-domain-driven-design-and-the-hexagonal-architecture
共享程式碼
防腐層