Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
模組化的Swift架構(二) DDD速成
Search
Hai Feng Kao
June 23, 2022
Programming
930
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
模組化的Swift架構(二) DDD速成
2022/6/21 ios@Taipei分享
介紹Domain Driven Design
Hai Feng Kao
June 23, 2022
More Decks by Hai Feng Kao
See All by Hai Feng Kao
物件導向的文藝復興:用DCI重塑程式設計的藝術
haifengkao
0
190
模組化的Swift架構(一) Redux入門
haifengkao
0
160
日常生活中的腦殘
haifengkao
0
290
機器學習超入門
haifengkao
0
190
UICollectionView自動布局
haifengkao
1
470
宅宅設計入門2
haifengkao
2
310
宅宅設計入門
haifengkao
5
330
Other Decks in Programming
See All in Programming
ALB ログから Trace を気合で繋げる技術
fohte
7
880
『寄り添うラジオ』をAIで作る 体験価値から逆算した、会話しないUXと品質設計
theoriatec2024
3
150
Heart of Swift Concurrency
koher
0
240
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
260
世界の中心で、AI(App Intents)をさけぶ ー App Intents中心設計の実践ガイド
touyou
0
390
AI に Inclusive UI を書かせよう — Design Rules Skill で Compose UI を作り直す
theoriatec2024
1
470
Security issues being discussed on Web Platforms
petamoriken
0
750
How I Stole PSI from Android Studio - DroidKaigi2026
worker8
0
110
Swift愛好会100回記念 第1回を振り返る
jollyjoester
0
120
Intent as Code
shoppingjaws
6
920
AGENTS.md Is Not Enough:Build Skills, Don't Download Them
lx_t
0
110
From 6 People Classroom Meetup to 100 People Regional Conference / FOSS4G Hiroshima 2026
furukawayasuto
0
130
Featured
See All Featured
Practical Orchestrator
shlominoach
191
12k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
980
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.2k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4.3k
Become a Pro
speakerdeck
PRO
31
6.2k
How to Think Like a Performance Engineer
csswizardry
28
2.8k
How STYLIGHT went responsive
nonsquared
100
6.3k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
310
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
660
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
共享程式碼
防腐層