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
93
Clean Architecture
Takuma Shimizu
August 01, 2018
Tweet
Share
More Decks by Takuma Shimizu
See All by Takuma Shimizu
Swift Attributes
hokuron
0
360
Peek in Calendar implementation of swift-foundation
hokuron
0
140
MVVM
hokuron
0
37
Summon Rust from Swift
hokuron
0
620
Opaque Result Type in Swift with Rust
hokuron
0
130
Generalized accessors
hokuron
0
63
Ownership of Swift as seen from iteration and Rust
hokuron
1
620
Clean Architecture 3
hokuron
0
31
Clean Architecture 2
hokuron
0
50
Other Decks in Programming
See All in Programming
MCP with Cloudflare Workers
yusukebe
2
230
コンテナをたくさん詰め込んだシステムとランタイムの変化
makihiro
1
150
PHPで学ぶプログラミングの教訓 / Lessons in Programming Learned through PHP
nrslib
4
400
nekko cloudにおけるProxmox VE利用事例
irumaru
3
460
rails stats で紐解く ANDPAD のイマを支える技術たち
andpad
1
300
テストケースの名前はどうつけるべきか?
orgachem
PRO
0
160
情報漏洩させないための設計
kubotak
4
860
return文におけるstd::moveについて
onihusube
1
1.3k
menu基盤チームによるGoogle Cloudの活用事例~Application Integration, Cloud Tasks編~
yoshifumi_ishikura
0
110
数十万行のプロジェクトを Scala 2から3に完全移行した
xuwei_k
0
350
テストコード書いてみませんか?
onopon
2
210
htmxって知っていますか?次世代のHTML
hiro_ghap1
0
350
Featured
See All Featured
Unsuck your backbone
ammeep
669
57k
Music & Morning Musume
bryan
46
6.2k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.3k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
66k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
Typedesign – Prime Four
hannesfritz
40
2.4k
Code Reviewing Like a Champion
maltzj
521
39k
RailsConf 2023
tenderlove
29
940
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
28
4.4k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
6
450
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
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ɹ ୡਓʹֶͿιϑτΣΞ ͷߏͱઃܭʱ ʢ֯యɾߴਖ਼߂༁ʣ
ॻ੶հ ͦͷଞ ϰΝʔϯɾϰΝʔϊϯ ʰ࣮ફυϝΠϯۦಈઃ ܭʱʢߴਖ਼߂༁ʣ
ॻ੶հ ͦͷଞ ΤϦοΫɾΤϰΝϯε ʰΤϦοΫɾΤϰΝϯε ͷυϝΠϯۦಈઃܭʱ ʢࠓؔ߶म ɹஐӈܡɾ༞ࢠ ༁ʣ