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
Clean Architecture Outline
Search
USAMI Kosuke
August 29, 2017
Programming
3
480
Clean Architecture Outline
https://kanmoba.connpass.com/event/64315/
USAMI Kosuke
August 29, 2017
Tweet
Share
More Decks by USAMI Kosuke
See All by USAMI Kosuke
Onsager代数とその周辺 / Onsager algebra tsudoi
usamik26
0
530
Apple HIG 正式名称クイズ結果発表 / HIG Quiz Result
usamik26
0
110
ゆめみ大技林製作委員会の立ち上げの話 / daigirin project
usamik26
0
280
@ViewLoadingプロパティラッパの紹介と自前で実装する方法 / @ViewLoading property wrapper implementation
usamik26
0
430
これからUICollectionViewを実践活用する人のためのガイド / Guide to UICollectionView
usamik26
1
690
Xcodeとの最近の付き合い方のはなし / Approach To Xcode
usamik26
2
610
UICollectionView Compositional Layout
usamik26
0
680
Coding Swift with Visual Studio Code and Docker
usamik26
0
450
Swift Extension for Visual Studio Code
usamik26
2
910
Other Decks in Programming
See All in Programming
初めてDefinitelyTypedにPRを出した話
syumai
0
420
Remix on Hono on Cloudflare Workers
yusukebe
1
290
RubyLSPのマルチバイト文字対応
notfounds
0
120
Less waste, more joy, and a lot more green: How Quarkus makes Java better
hollycummins
0
100
どうして僕の作ったクラスが手続き型と言われなきゃいけないんですか
akikogoto
1
120
WebフロントエンドにおけるGraphQL(あるいはバックエンドのAPI)との向き合い方 / #241106_plk_frontend
izumin5210
4
1.4k
macOS でできる リアルタイム動画像処理
biacco42
9
2.4k
cmp.Or に感動した
otakakot
3
200
CSC509 Lecture 09
javiergs
PRO
0
140
レガシーシステムにどう立ち向かうか 複雑さと理想と現実/vs-legacy
suzukihoge
14
2.2k
「今のプロジェクトいろいろ大変なんですよ、app/services とかもあって……」/After Kaigi on Rails 2024 LT Night
junk0612
5
2.2k
Make Impossible States Impossibleを 意識してReactのPropsを設計しよう
ikumatadokoro
0
200
Featured
See All Featured
The Language of Interfaces
destraynor
154
24k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
Product Roadmaps are Hard
iamctodd
PRO
49
11k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
The Cult of Friendly URLs
andyhume
78
6k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
410
A Philosophy of Restraint
colly
203
16k
The Cost Of JavaScript in 2023
addyosmani
45
6.8k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
506
140k
Ruby is Unlike a Banana
tanoku
97
11k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Transcript
Clean Architecture ͷ େΛͬ͘͟Γཧղ͢Δ USAMI Kosuke Fenrir Inc.
ࣗݾհ • Ӊࠤݟެี (@usamik26) • ϑΣϯϦϧגࣜձࣾ • iOS ΞϓϦ։ൃ :
Swift / Xamarin (C#)
Clean Architecture • ݩهࣄ : The Clean Architecture | 8th
Light • ΞϓϦέʔγϣϯͷઃܭύλʔϯͷͻͱͭ • ϞόΠϧΞϓϦ։ൃք۾Ͱ࠷ۙԿ͔͕ڍ͕ͬͨ
ݩهࣄ
ղઆهࣄ͍͔ͭ͋͘Δ͚Ͳɾɾɾ • ݩهࣄղઆهࣄɺղઆ͕ࡉ͔͗͢ΔͷͰͳ͍͔ʁ • ૈཻ͍ͷͱࡉཻ͔͍ͷ͕͍ࠞͬͯ͟ΔͷͰ • ·ͣɺͬ͘͟Γେ͖ͳΈΛѲΛͨ͠ํ͕ྑ͍
େ͖ͳΈΛѲ͢Δ • ·ͣશମਤΛ͏ҰݟͯΈΔ
None
ਤΛॻ͖ͯ͠ΈΔ • Onion ਤॳݟͰϐϯͱ͜ͳ͍ʢݸਓͷײͰ͢ʣ • ͋͑ͯੲͳ͕Βͷ Layer ਤͰॻ͖ͯ͠ΈΔ
None
MV◦ ύλʔϯͱൺͯΈΔ
ൺͨ݁Ռ • MV◦ ύλʔϯͰ Model ਂ۷Γ͞Ε͍ͯͳ͔ͬͨ • View ͱ Model
ͱͷʹॏ͕͋ͬͨ • M ͱ V ͷͭͳ͗ํʹ͍ͯͨ͠ʢMVC / MVP / MVVMʣ • Model ͷதͰɺಉ༷ͷ͕Ͱ͖Δ • ϏδωεϩδοΫͱ DB ͱͷ
ґଘؔΛݟͯ͠ΈΔ
ґଘ͕ؔٯస͍ͯ͠Δ • ैདྷͷ Layer ߏͰ্͔ΒԼґଘ͍ͯͨ͠ • Clean Architecture ֎͔Βґଘ͍ͯ͠Δ •
Onion ਤ͜ΕΛදݱ͍ͯͨ͠
ิ : ґଘؔΛٯసͤ͞Δख๏ • Լͷͷ Interface Λ্ͷ͕ఆٛɺґଘੑͷೖʢDIʣΛ͏ • ͦͦґଘؔͱ͍͏ͷ Interface
ʹର͢Δґଘ • ͦͷͨΊɺInterface ͷఆٛΛ୭͕͔࣋ͭͰґଘ͕ؔมΘΔ
ґଘؔͷมԽʹΑͬͯԿ͕ى͜Δ͔ • Business Rules ͕த৺ͱͳΔ • ֎քʢUI DB ͳͲʣʹࠨӈ͞Εͳ͍ੈք͕Ͱ͖Δ
֎քʹӨڹ͞Εͳ͍ੈք • ७ਮͳϞσϦϯάͷੈք • Domain Driven Design ͷύλʔϯ͕༗ӹ • ͞Βʹಥ͖٧ΊΔͱ෭࡞༻ʢSide
Effectʣͷͳ͍ੈք
Clean Architecture ࠾༻࣌ͷཹҙࣄ߲ • Business Rules ʹϩδοΫΛूத͢Δ • Controllers /
Presenters / Gateways ബ͘͢Δ • UI / DB / ... ݸʑͷׂʹಛԽ͢Δ
࠾༻ྫ : ΞϨϯδ͋Γ
ิ : Controllers / Presenters • Clean Architecture ͷͱҰॹʹޠΒΕΔ͜ͱ͕ଟ͍ •
͔͠͠ɺΞʔΩςΫνϟઃܭͷͱ͚ͯཧղͨ͠ํ͕ྑ͍ • ͪΖΜɺ༗ӹͳઃܭύλʔϯͰ͋Δ • MVC / MVP / MVVM ͷΑ͏ʹ M ͱ V ΛͲ͏ͭͳ͙͔ͷ
͓ΘΓʹ • େΛѲ͢Δखॿ͚ʹͳͬͨͳΒ͍Ͱ͢ • ͦͷ͏͑ͰݩهࣄղઆهࣄΛಡΈ͢ • ͢Δͱɺ৽ͨͳؾ͖͕ͮ͋Δ͔