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
720
模組化的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
模組化的Swift架構(一) Redux入門
haifengkao
0
120
日常生活中的腦殘
haifengkao
0
260
機器學習超入門
haifengkao
0
160
UICollectionView自動布局
haifengkao
1
420
宅宅設計入門2
haifengkao
2
250
宅宅設計入門
haifengkao
5
300
Other Decks in Programming
See All in Programming
1BRC--Nerd Sniping the Java Community
gunnarmorling
0
340
サイコロで理解する統計的仮説検定の考え方
tatamiya
4
920
Rubyでたのしむクリエイティブコーディング/Enjoy Creative coding with Ruby
chobishiba
1
180
Build Apps for iOS, Android & Desktop in 100% Kotlin With Compose Multiplatform (mDevCamp 2024)
zsmb
0
320
大規模UIKitベースアプリへのTCAの段階的導入/gradual-adoption-of-tca-in-a-large-scale-uikit-based-app
takehilo
1
130
Changed Rules: Architectures with Lightweight Stores
manfredsteyer
PRO
0
240
Apache Hive 4 on Treasure Data
ryukobayashi
0
180
try!Swift Tokyo 2024 参加報告 LT
akidon0000
1
220
はてなにおける CSS Modules、及び CSS Modules に足りないもの / CSS Modules in Hatena, and CSS Modules missing parts
mizdra
7
920
PostmanでAPIの動作確認が楽になった話
h455h1
0
170
Ruby Function Composition
bkuhlmann
1
330
Milestoner
bkuhlmann
1
410
Featured
See All Featured
Build The Right Thing And Hit Your Dates
maggiecrowley
24
2k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
9
8.3k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
25
2.3k
Building Better People: How to give real-time feedback that sticks.
wjessup
355
18k
Facilitating Awesome Meetings
lara
42
5.6k
Faster Mobile Websites
deanohume
299
30k
Adopting Sorbet at Scale
ufuk
68
8.6k
Building Flexible Design Systems
yeseniaperezcruz
319
37k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
GraphQLとの向き合い方2022年版
quramy
32
12k
RailsConf 2023
tenderlove
4
540
Git: the NoSQL Database
bkeepers
PRO
422
63k
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
共享程式碼
防腐層