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
Search
Takuma Shimizu
August 01, 2018
Programming
0
89
Clean Architecture
Takuma Shimizu
August 01, 2018
Tweet
Share
More Decks by Takuma Shimizu
See All by Takuma Shimizu
Swift Attributes
hokuron
0
340
Peek in Calendar implementation of swift-foundation
hokuron
0
140
MVVM
hokuron
0
33
Summon Rust from Swift
hokuron
0
600
Opaque Result Type in Swift with Rust
hokuron
0
130
Generalized accessors
hokuron
0
58
Ownership of Swift as seen from iteration and Rust
hokuron
1
610
Clean Architecture 3
hokuron
0
24
Clean Architecture 2
hokuron
0
46
Other Decks in Programming
See All in Programming
Less waste, more joy, and a lot more green: How Quarkus makes Java better
hollycummins
0
100
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
110
Kaigi on Rails 2024 〜運営の裏側〜
krpk1900
1
200
弊社の「意識チョット低いアーキテクチャ」10選
texmeijin
5
24k
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
170
OSSで起業してもうすぐ10年 / Open Source Conference 2024 Shimane
furukawayasuto
0
100
Jakarta Concurrencyによる並行処理プログラミングの始め方 (JJUG CCC 2024 Fall)
tnagao7
1
290
RubyLSPのマルチバイト文字対応
notfounds
0
120
Creating a Free Video Ad Network on the Edge
mizoguchicoji
0
120
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
470
「今のプロジェクトいろいろ大変なんですよ、app/services とかもあって……」/After Kaigi on Rails 2024 LT Night
junk0612
5
2.1k
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
1.9k
Featured
See All Featured
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
860
Building an army of robots
kneath
302
43k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
Designing for Performance
lara
604
68k
Adopting Sorbet at Scale
ufuk
73
9.1k
Rails Girls Zürich Keynote
gr2m
94
13k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
Bash Introduction
62gerente
608
210k
Transcript
ΫϦʔϯΞʔΩςΫ νϟࣄ࢝Ί ٕज़ษڧձ
ΞϓϦ෦େࡕ՝ ਗ਼ਫຏ !IPLVSPO J04 3VCZPO3BJMT
ΫϦʔϯΞʔΩςΫ νϟࣄ࢝Ί ٕज़ษڧձ
͜ͷൃදʹ͍ͭͯ w ͜·Ίʹ࣭Λड͚͚·͢ w Ε͍ͯͨΒࢦఠ͍ͯͩ͘͠͞! w ͦΕҎ֎Ͱ్தͰ࣭͕͋ΕԿͳΓͱ w $MFBO"SDIJUFDUVSFຊ ݪஶɾ༁
Λݩʹߏ w ΫϦʔϯΞʔΩςΫνϟͷ؊ͱͳΔ෦Λநग़
ΫϦʔϯΞʔΩςΫ νϟશʹཧղͨ͠ ඪ 15&
ඪ ݠḮ ΫϦʔϯΞʔΩςΫ νϟͳΜ͔͔Δ
ΫϦʔϯΞʔΩςΫνϟͷ؊ ޡղू ॻ੶հ ͓Βͤ
ΫϦʔϯΞʔΩςΫνϟͷ؊
ࢀরɿIUUQTUIMJHIUDPNCMPHVODMFCPCUIFDMFBOBSDIJUFDUVSFIUNM
None
w ʮΫϦʔϯΞʔΩςΫνϟʯͱ͍͏ΞʔΩςΫνϟͳ͍ w ΑΓྑ͍ ΫϦʔϯͳ ΞʔΩςΫνϟΛࢦ֓͢೦ w ஶऀͷ3PCFSU$.BSUJOʹΑΔz$MFBOzγϦʔζͷҰͭ w $MFBO$PEF
w $MFBO$PEFS w $MFBO"SDIJUFDUVSF
ࢀরɿIUUQTUIMJHIUDPNCMPHVODMFCPCUIFDMFBOBSDIJUFDUVSFIUNM
None
ΫϦʔϯΞʔΩςΫνϟͷ؊ w #VTJOFTT3VMFT w &OUJUZ w 6TF$BTF w ґଘํ w
*OUFSGBDF"EBQUFST
#VTJOFTT3VMFT
&OUJUZ w $SJUJDBMCVTJOFTTSVMF w શʹಠཱ w υϝΠϯۦಈઃܭͷυϝΠϯϞσϧ w &OUJUZ 3FGFSFODF
PCKFDUɼ7BMVFPCKFDUɼ4FSWJDF w ʰΦϒδΣΫτࢦιϑτΣΞֶ004&ʱͷ༻ޠ
6TF$BTF w "QQMJDBUJPOTQFDJpDCVTJOFTTSVMF w 6* %# ϑϨʔϜϫʔΫͷӨڹड͚ͳ͍ w ΞϓϦӡ༻ͷมߋͷӨڹड͚Δ w
&OUJUZʢυϝΠϯϞσϧʣͷΫϥΠΞϯτ
#VTJOFTT3VMFT w$SJUJDBMCVTJOFTTSVMF w"QQMJDBUJPOTQFDJpDCVTJOFTTSVMF རӹ૿Ճɺඅ༻ݮʹؔΘΔϧʔϧखଓ͖
$SJUJDBMWT"QQTQFDJpD &OUJUZWT6TF$BTF w $SJUJDBMखಈͰ࣮ߦՄೳ w "QQTQFDࣗಈԽ͞Ε͍ͯΔ͜ͱ͕લఏ w $SJUJDBMγεςϜ͔Βಠཱ w
"QQTQFDγεςϜʹґଘ
l$SJUJDBMz
l$SJUJDBMz#VTJOFTT3VMF ˣ l&OUFSQSJTFz#VTJOFTT3VMF
l&OUFSQSJTFz#VTJOFTT3VMF #$ΞϓϦͰʜ w ར༻ऀෆಛఆଟͷҰൠϢʔβʔ w ൃݩͷച্རӹɺۀʹӨڹΛ༩͑ͳ͍ w ͦΖΜΛ͘Α͏ͳखଓ͖͕ଘࡏ͠ͳ͍ ˠ$SJUJDBM"QQMJDBUJPOTQFDJpDͱಉٛʁ
$SJUJDBMͱ"QQTQFDͷҧ͍ w γεςϜ͔Βೖग़ྗͱͷڑͷҧ͍ w มߋසͱมߋཧ༝ͷҧ͍ w ୯Ұͷݪଇ 4JOHMF3FTQPOTJCJMJUZ1SJODJQMF
ೖग़ྗͷڑ w ʮ-FWFMʯͱ͍͏֓೦ w ϢʔβʔγεςϜͷೖྗͱग़ྗ͔ΒΕ͍ͯΔ΄Ͳ -FWFM͕ߴ͍ w -FWFM͕ҟͳΕมߋසɾཧ༝ҟͳΔ w &OUJUZ͔6TF$BTFͰ໎ͬͨΒz-FWFMzΛൺֱ
w ΑΓ-FWFM͕ߴ͍΄͏Λ&OUJUZʹ w ୯ҰͷݪଇΛద༻͍ͯ͠ΕΑΓ؆୯ʹͳΔ
#VTJOFTT3VMFTͷ·ͱΊ w &OUJUZ $SJUJDBM ͱ6TF$BTF "QQMJDBUJPOTQFDJpD w $SJUJDBMγεςϜʹґΒͣɺ"QQTQFDγεςϜ͋Γ͖ w
&OUJUZશʹಠཱ͠ɺ6TF$BTFͦͷΫϥΠΞϯτ w -FWFMͷܭଌͰᐆດ͞ճආ w #VTJOFTT3VMFʹ͚ͩͰͳ͘Ͳ͜Ͱద༻Մೳ
ґଘํ w ৗʹҰํʹ͚ͩʹґଘ w ґଘؔٯసͷݪଇ %FQFOEFODZJOWFSTJPOQSJODJQMF w ೖग़ྗσʔλͷґଘ੍
Ұํͷґଘ w ͜ͷ෦ w ԼҐ-FWFMͷϨΠϠʔ ίϯϙʔωϯτ ্Ґ-FWFMͷϨΠϠʔ ίϯϙʔωϯτ ʹґଘ͢Δ
w ্Ґ-FWFMɺԼҐ-FWFMͰ༻͞Ε͍ͯΔ໊લΛ ར༻͍͚ͯ͠ͳ͍ w ܕ໊ɺϝιουɺϓϩύςΟͳͲ w ্Ґ-FWFMɺԼҐ-FWFMͰ༻͞Ε͍ͯΔσʔλߏΛ ར༻͍͚ͯ͠ͳ͍
ґଘؔٯసͷݪଇ w ͜ͷ෦
6TF$BTF $POUSPMMFS 1SFTFOUFS
6TF$BTF $POUSPMMFS 1SFTFOUFS
6TF$BTF $POUSPMMFS 1SFTFOUFS
6TF$BTF 1SFTFOUFS
6TF$BTF 1SFTFOUFS
6TF$BTF 1SFTFOUFS
6TF$BTF 1SFTFOUFS 0VUQVU *OUFSGBDF
6TF$BTF 1SFTFOUFS 0VUQVU *OUFSGBDF
6TF$BTF 1SFTFOUFS 0VUQVU *OUFSGBDF 6TF$BTF 1SFTFOUFS
ґଘؔٯసͷݪଇ w্Ґ-FWFMͷϨΠϠʔ ίϯϙʔωϯτ ͕ ԼҐ-FWFMͷϨΠϠʔʹґଘ͢ΔͷΛ͙ w *OUFSGBDFQSPUPDPMΛؒʹڬΜͰ্Ґ-FWFMଆʹஔ w *OUFSGBDF"EBQUFST
ೖग़ྗσʔλͷґଘ੍ w ୯७ͳσʔλߏମ w ݴޠΈࠐΈͷϓϨʔϯͳΦϒδΣΫτͰߏ w ࣗଞͷϨΠϠʔಠࣗͷΦϒδΣΫτؚΊͳ͍ w σʔλߏମҰͭͷґଘ w
্Ґ-FWFMɺԼҐ-FWFMͷσʔλߏମΛΒͳ͍
ґଘํͷ·ͱΊ w ؔ৺ͷ w ґଘํৗʹҰఆ w ԼҐ-FWFM্Ґ-FWFMʹґଘ$ٯېࢭ% w ϨΠϠʔͷؒΛ·͕ͨΔσʔλߏʹద༻͞ΕΔ w
্Ґ͕ԼҐʹґଘ͢Δ߹ґଘؔٯసͷݪଇ
ΫϦʔϯΞʔΩςΫνϟͷ؊ w &OUJUZ $SJUJDBM#VTJOFTT3VMF w 6TF$BTF "QQMJDBUJPOTQFDJpD#VTJOFTT3VMF w
l-FWFMz w ґଘํɺґଘؔٯసͷݪଇ
؊ͷ֎ଆ & &
w *OUFSGBDF"EBQUFS w .7$ .77. .71 .717.FUD w 42- 3&45"1*
(SBQI2-FUD w 'SBNFXPSL %SJWFS w J04 "OESPJE 8FC .BSJB%# 'JSFCBTFFUD
ΫϦʔϯΞʔΩςΫνϟͷ؊ͷ ֎ଆͷ؊ w ࠾༻͢ΔઃܭύλʔϯσʔλϕʔεͳͲͷܾఆΛ୨্͛ w ΑΓଆͷ։ൃʹूதͰ͖Δ w ຊͷҙຯͰ֎ଆΛҙࣝ͠ͳ͍ͰࡁΉ
ΫϦʔϯΞʔΩςΫνϟͷ؊ w &OUJUZ $SJUJDBM#VTJOFTT3VMF w 6TF$BTF "QQMJDBUJPOTQFDJpD#VTJOFTT3VMF w
l-FWFMz w ґଘํɺґଘؔٯసͷݪଇ
ޡղू
ޡղͦͷ̍ 5SBOTMBUPSඞਢ
ޡղͦͷ̍ 5SBOTMBUPSඞਢ ͑ ෆཁ
ޡղͦͷ 3FQPTJUPSZͱ %BUB4UPSFηοτ
ޡղͦͷ 3FQPTJUPSZͱ %BUB4UPSFηοτ ͑ ෆཁ
ޡղͦͷ .71ύλʔϯΛ͏
ޡղͦͷ .71ύλʔϯΛ͏ ͑ ԿͰ͍͍
ޡղͦͷ &OUJUZ%%%Ͱઃܭ
ޡղͦͷ &OUJUZ%%%Ͱઃܭ ͑ ԿͰ͍͍
ޡղͦͷ ϨΠϠʔΛ·͙ͨͱ͖ ʹ3FBDUJWF&YUFOTJPOT ศར͡ΌͶʁ
ޡղͦͷ ϨΠϠʔΛ·͙ͨͱ͖ʹ 3FBDUJWF&YUFOTJPOTศར͡Ό Ͷʁ ͑ Ίͯ
ޡղͦͷ Δ͜ͱଟ͘ͳ͔ͬ͢Ͷ
ޡղͦͷ Δ͜ͱଟ͘ͳ͔ͬ͢Ͷ ͑ ͦͷͱ͓ΓɻͰ ίʔυϦʔσΟϯά ͷෛՙԼ͕Δ
ޡղͦͷ ॳݟࡴͩ͠ΑͶʁ
͑ ॳݟࡴͩ͠ΑͶʁ ͏Μɺ ͔ͩΒࠓઆ໌ͯ͠Δ
ΫϦʔϯΞʔΩςΫ νϟશʹཧղͨ͠ ඪ 15&
ඪ ݠḮ ΫϦʔϯΞʔΩςΫ νϟͳΜ͔͔Δ
ޡ ਖ਼ 5SBOTMBUPSඞਢ ෆཁ 3FQPTJUPSZͱ %BUB4UPSFηοτ ෆཁ .71ύλʔϯΛ͏ ͳΜͰ͍͍ &OUJUZ%%%Ͱઃܭ
ͳΜͰ͍͍ ϨΠϠʔΛ·͙ͨͱ͖ʹ3FBDUJWF&YUFOTJPOศ ར͡ΌͶʁ Ίͯ Δ͜ͱଟ͘ͳ͔ͬ͢Ͷ Ӿཡ࣮ ͳΒΔՁ͋Γ
ॻ੶հ ݪஶ Robert C. Martin, Clean Architecture: A Craftsman's Guide
to Software Structure and Design
ॻ੶հ ༁ ϩόʔτɾ$Ϛʔνϯ ʰ$MFBO"SDIJUFDUVSFɹ ୡਓʹֶͿιϑτΣΞ ͷߏͱઃܭʱ ʢ֯యɾߴਖ਼߂༁ʣ
ॻ੶հ ͦͷଞ ϰΝʔϯɾϰΝʔϊϯ ʰ࣮ફυϝΠϯۦಈઃ ܭʱʢߴਖ਼߂༁ʣ
ॻ੶հ ͦͷଞ ΤϦοΫɾΤϰΝϯε ʰΤϦοΫɾΤϰΝϯε ͷυϝΠϯۦಈઃܭʱ ʢࠓؔ߶म ɹஐӈܡɾ༞ࢠ ༁ʣ