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
マネーフォワードの設計へのアプローチ
Search
koutalou
March 16, 2017
4
3.6k
マネーフォワードの設計へのアプローチ
CAMPFIRE iOS #1で発表した発表資料です。
Architectureの選定や、マネーフォワードでのClean Architectureの取り組みについてのお話です。
koutalou
March 16, 2017
Tweet
Share
More Decks by koutalou
See All by koutalou
実際Xamarinってどうなの?
koutalou
3
2.1k
iOS Clean Architecture のすすめ
koutalou
26
23k
let product = [designer, engineer].reduce(0) { $0 + $1.skill * $1.vision }
koutalou
0
390
tvOS tips
koutalou
1
1.8k
Featured
See All Featured
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
33
2.7k
Learning to Love Humans: Emotional Interface Design
aarron
274
40k
Mobile First: as difficult as doing things right
swwweet
222
9k
The Cult of Friendly URLs
andyhume
78
6.1k
Agile that works and the tools we love
rasmusluckow
328
21k
Raft: Consensus for Rubyists
vanstee
137
6.7k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3.1k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
How to train your dragon (web standard)
notwaldorf
89
5.8k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
4 Signs Your Business is Dying
shpigford
182
22k
Transcript
ϚωʔϑΥϫʔυͷઃܭͷΞϓϩʔν CAMPFIRE iOS #1 2017/03/16 גࣜձࣾϚωʔϑΥϫʔυ ࣇۄଠ
ࣗಈՈܭɾࢿ࢈ཧαʔϏεʰϚωʔϑΥϫʔυʱ iOS, AndroidΞϓϦ։ൃΛ୲͍ͯ͠·͢ ࣇۄଠ!LPVUBMPV ΤϯδχΞ ࣗݾհ
༰ 1 "SDIJUFDUVSFʹ͍ͭͯ 2 "SDIJUFDUVSFͷબఆ 3 $MFBO"SDIJUFDUVSFͷऔΓΈ
1 2 "SDIJUFDUVSFͷબఆ 3 $MFBO"SDIJUFDUVSFͷऔΓΈ 2 3 "SDIJUFDUVSFʹ͍ͭͯ ༰
طଘͷ"SDIJUFDUVSF .7$"SDIJUFDUVSF .71 .77. "SDIJUFDUVSF
طଘͷ"SDIJUFDUVSF 7*1&3"SDIJUFDUVSF %%%"SDIJUFDUVSF
$MFBO"SDIJUFDUVSF 7JFX 1SFTFOUFS 6TF$BTF 5SBOTMBUPS .PEFM %BUB4UPSF &OUJUZ 3FQPTJUPSZ 1SFTFOUBUJPO-BZFS
%PNBJO-BZFS %BUB-BZFS w ΛࡉԽ͢Δ͜ͱͰɺ֤ϨΠϠ͕ԿΛ୲͢Δ͔໌֬ʹͳΔ w 6*ͱϏδωεϩδοΫΛͰ͖ɺϨΠϠؒͷґଘΛ࠷খݶʹͰ͖Δ w ϨΠϠؒૄ݁߹ͳͷͰϞδϡʔϧͷஔ͖͑ɺςετ͕༰қ
$MFBO"SDIJUFDUVSFͷ1SPT$POT ɹQSPT w ಛఆͷ-BZFSͷංେԽΛ͛Δ w ݴޠԽ͞Εͨఆ͕ٛ͋ΔͷͰڞ௨ͷઃܭҙ͕ࣝ࣋ͯΔ w ͕ࡉԽ͞Ε͍ͯΔͷͰϝϯς͍͢͠ DPOT w
ίʔυྔɺϑΝΠϧ͕ଟ͍ w ֶशίετ͕ߴ͍
औΓΈ "SDIJUFDUVSFʹ͍ͭͯ 2 "SDIJUFDUVSFͷબఆ $MFBO"SDIJUFDUVSFͷऔΓΈ 1 3
Α͋͘ΔΞʔΩςΫνϟͷ w ॏͳΔ༷มߋෳࡶͳ༷ʹରԠ͢ΔͨΊʹ7JFX$POUSPMMFS ಛఆͷ.PEFM͕ංେԽ͠ɺϏδωεϩδοΫͷຊ࣭Λݟࣦ͏ w ಛఆͷϨΠϠ͕ෳͷΛ࣋ͪґଘͷߴ͍ෳࡶͳίʔυ͕ੜ·ΕΔ ΤϯδχΞ ΤϯδχΞ ΤϯδχΞ ͍༷͢͝มߋͩɺɺ
·ͨViewController͕ΒΉ ϏδωεϩδοΫ͜Μͳ ॻ͖ํͪ͠Ό͏Μͩɾɾ Model͕͍ΖΜͳॲཧΛ ؚΊͯෳࡶ͗͢Δɾɾ → VIPERClean ArchitectureΛݕ౼ͯ͠ྑ͍
Λײ͍ͯ͡ͳ͍έʔε w গਓͰنͷখ͞ͳΞϓϦέʔγϣϯɺશ༰ΛѲ͍͢͠ w εϞʔϧελʔτͳͲͰ·ͣಈ͘ͷΛ࡞Γ͍ͨ w ϩδοΫ͕γϯϓϧͰಛʹෳࡶͳॲཧ͕ଘࡏ͠ͳ͍ ΤϯδχΞ ΤϯδχΞ ΤϯδχΞ
ҰਓͰ։ൃ͢Δ͠ɺ ͦΜͳʹنେ͖͘ͳ͍ ͱʹ͔͘εϐʔυײॏࢹ ·ͣϞϊΛ࡞Γ͍ͨ ΞϓϦέʔγϣϯͷ ϩδοΫ͕ෳࡶͰͳ͍ → VIPERClean Architecture͍͍ͯͳ͍
"1*ʹΑΔෳࡶੑʹ͍ͭͯ ͭͷը໘Ͱෳͷ"1*͔ΒσʔλΛऔಘ͢Δ߹ɺ 7JFXͰ͏.PEFMม͕ඞཁʹͳΓϩδοΫෳࡶʹͳΓ͕ͪ "1* "1* "1* "1* "1* → Clean
ArchitectureΛݕ౼ͯ͠ྑ͍
ը໘"1*ͷΑ͏ͳ߹ɺ3FTQPOTF͕7JFXͷ.PEFMͱͯ͠ ͑Δέʔε͕ଟ͍ͨΊϩδοΫγϯϓϧʹͳΔ "1* "1* "1*ʹΑΔෳࡶੑʹ͍ͭͯ → Clean Architectureෆ͖ɺVIPERݕ౼ͯ͠ྑ͍
"SDIJUFDUVSFͷબఆ w ظతͳ։ൃɺϝϯςφϯε͕ඞཁ͔ w ୯ಠ։ൃ͔։ൃϝϯόʔଟ͘ྲྀಈత͔ w αʔόଆͷϦιʔε͕ेͰ$MJFOUγϯϓϧʹͰ͖Δ͔ w $MJFOUଆͰෳࡶͳϩδοΫΛ࣋ͨ͟ΔΛಘͳ͍͔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ʹಋೖ 7JFX 6TF$BTF 5SBOTMBUPS .PEFM %BUB4UPSF &OUJUZ 3FQPTJUPSZ
1SFTFOUFS w 7JFX1SFTFOUFS w %PNBJO%PNBJO w %BUB%BUB w $PSF௨৴ͳͲͷج൫෦ w 4UZMF6*$PNQPOFOUͷڞ௨ఆٛ w 6UJMJUZศརػೳͷू߹
'SBNFXPSLԽ ֤ϨΠϠΛ'SBNFXPSLͰׂ -BZFSؒΛૄ݁߹ɺґଘؔΛ࠷খݶʹ͢ΔͨΊʹಋೖ 7JFX 6TF$BTF 5SBOTMBUPS .PEFM %BUB4UPSF &OUJUZ 3FQPTJUPSZ
1SFTFOUFS %PNBJO %BUB $PSF 6UJMJUZ 4UZMF 7JFX
4UZMF(VJEF"QQ 'SBNFXPSLʹ͢Δ͜ͱͰڞ௨ԽͰ͖ .POFZ'PSXBSEΞϓϦʹͦͷ··͑Δ Money Forward App Style Guide App Style
Framework
4UZMF(VJEF"QQ Money Forward App Style Guide App Style Framework 'SBNFXPSLʹ͢Δ͜ͱͰڞ௨ԽͰ͖
.POFZ'PSXBSEΞϓϦʹͦͷ··͑Δ
6*$PNQPOFOUͷڞ௨Խ 4UPSZCPBSEͰઃఆ͢Δ6*$PNQPOFOUʹઃఆΛೖΕͨ͘ͳ͍ ͚Ͳ4UPSZCPBSE্Ͱө͞Εͯ΄͍͠ /PSJ ίʔυͰ4UPSZCPBSEͷ 7JFXΛσβΠϯ͢Δ !ZVLJBTBJ IUUQTHJUIVCDPNZVLJBTBJ/PSJ
ςϯϓϨʔτͷࣗಈੜ $MFBO"SDIJUFDUVSFϑΝΠϧ͕ଟ͘ͳΔͷͰɺ ςϯϓϨʔτΛࣗಈੜ͢Δͱ͔ͳΓָ IUUQTHJUIVCDPNCBOO[BJ,VSJ ,VSJ 9DPEF1SPKFDUʹ $MFBO"SDIJUFDUVSFͷ ςϯϓϨʔτΛࣗಈੜͯ͘͠ΕΔ !CBOO[BJ
$MFBO"SDIJUFDUVSFͷஔ͖͑ Ұؾʹશͯ࡞Γ͠ͷΑ͏ͳϦϑΝΫλͤͣɺ ը໘୯ҐͰঃʑʹ$MFBO"SDIJUFDUVSFஔ͖͑
$MFBO"SDIJUFDUVSFͷஔ͖͑ 7JFX 1SFTFOU 6TF$BT 5SBOTMB .PEFM %BUB4U &OUJUZ 3FQPTJU Ұؾʹશͯ࡞Γ͠ͷΑ͏ͳϦϑΝΫλͤͣɺ
ը໘୯ҐͰঃʑʹ$MFBO"SDIJUFDUVSFஔ͖͑
$MFBO"SDIJUFDUVSFͷஔ͖͑ 7JFX 1SFTFOU 6TF$BT 5SBOTMB .PEFM %BUB4U &OUJUZ 3FQPTJU Ұؾʹશͯ࡞Γ͠ͷΑ͏ͳϦϑΝΫλͤͣɺ
ը໘୯ҐͰঃʑʹ$MFBO"SDIJUFDUVSFஔ͖͑ 7JFX 1SFTFOU 6TF$BT 5SBOTMB .PEFM %BUB4U &OUJUZ 3FQPTJU
$MFBO"SDIJUFDUVSFͷஔ͖͑ 7JFX 1SFTFOU 6TF$BT 5SBOTMB .PEFM %BUB4U &OUJUZ 3FQPTJU Ұؾʹશͯ࡞Γ͠ͷΑ͏ͳϦϑΝΫλͤͣɺ
ը໘୯ҐͰঃʑʹ$MFBO"SDIJUFDUVSFஔ͖͑ 7JFX 1SFTFOU 6TF$BT 5SBOTMB .PEFM %BUB4U &OUJUZ 3FQPTJU 7JFX 1SFTFOU 6TF$BT 5SBOTMB .PEFM %BUB4U &OUJUZ 3FQPTJU
ඇϑϨʔϜϫʔΫґଘ ɹ-BZFSؒΛ͑ΔΑ͏ͳϑϨʔϜϫʔΫʹґଘͤ͞ͳ͍ w ௨৴-BZFSͰ͚ͯ63-4FTTJPOΛ༻ w "MBNPpSF"1*,JUաͳػೳΛ࣋ͭͷͰΘͳ͍ w 6*ܥͷϥΠϒϥϦ-BZFSΛ͑ͳ͍ͷʹݶΔ w ྫ֎Ͱ3Y4XJGUΛಋೖ
3Y4XJGUͷ1SPT$POT ɹQSPT w 6TF$BTFͰͷ1SPNJTFॲཧͷهड़͕༰қ w 3FQPTJUPSZҎԼͷ*'ΛετϦʔϜͰهड़ w ը໘ؒ&WFOU௨ͷ.VMUJ$BTUΛετϦʔϜͰ࣮Մ DPOT w
ࠜװ෦Λ3Y4XJGUͷෆ۩߹ϝϯςφϯεঢ়گʹґଘ w 3Y4XJGUࣗମͷֶशίετ
1SPUPDPM0SJFOUFE1SPHSBNNJOH ɹ1SPUPDPM0SJFOUFE1SPHSBNNJOHΛҙࣝ͢Δ w QSPUPDPMΛͬͨ*'ʹΑΔ࠷খݶͷґଘؔ w QSPUPDPMʹ४ڌ࣮ͨ͠FYUFOTJPOͰهड़ w DMBTTۃྗΘͣTUSVDUͰ࣮͢Δ
1SPUPDPM0SJFOUFE1SPHSBNNJOH ɹ1SPUPDPM0SJFOUFE1SPHSBNNJOHΛҙࣝ͢Δ w QSPUPDPMΛͬͨ*'ʹΑΔ࠷খݶͷґଘؔ w QSPUPDPMʹ४ڌ࣮ͨ͠FYUFOTJPOͰهड़ w DMBTTۃྗΘͣTUSVDUͰ࣮͢Δ
1SPUPDPM0SJFOUFE1SPHSBNNJOH 1SFTFOUFS 6TF$BTF 5SBOTMBUPS .PEFM %BUB4UPSF &OUJUZ 3FQPTJUPSZ TUSVDU DMBTT
7JFX ɹ1SPUPDPM0SJFOUFE1SPHSBNNJOHΛҙࣝ͢Δ w QSPUPDPMΛͬͨ*'ʹΑΔ࠷খݶͷґଘؔ w QSPUPDPMʹ४ڌ࣮ͨ͠FYUFOTJPOͰهड़ w DMBTTۃྗΘͣTUSVDUͰ࣮͢Δ
Ϟδϡʔϧͷڞ༗ Ұ෦ͷϞδϡʔϧΛஔ͖͑Δ͚ͩͰ৭Μͳը໘ʹରԠՄೳ HomeTimelinePresenterImpl UserTimelinePresenterImpl 7JFX 1SFTFOUFS 6TF$BTF 5SBOTMBUPS .PEFM %BUB4UPSF
&OUJUZ 3FQPTJUPSZ 1SFTFOUFSͷΈϞδϡʔϧ͕ҟͳΔྫ
ςετͷ༰қੑ RepositoryMockImpl 7JFX 1SFTFOUFS 6TF$BTF 5SBOTMBUPS .PEFM %BUB4UPSF &OUJUZ 3FQPTJUPSZ
QSPUPDPMʹ४ڌͨ͠.PDLςετίʔυͰ ϨΠϠຖͷॊೈͳςετ͕Մೳ 3FQPTJUPSZΛ.PDLʹͯ͠ &OUJUZˠ.PEFMͷมΛςετ 6TF$BTFΛ.PDLʹͯ͠ɺ 7JFXͷ&WFOUʹର͢Δ1SFTFOUFSͷڍಈΛςετ UseCaseMockImpl
·ͱΊ
·ͱΊ %FTJHOFS OFFS "SDIJUFDUVSFʹۜͷؙͳ͍ Կ͕࠷ద͔ߟ͑ଓ͚Δ͜ͱ͕ॏཁ w "SDIJUFDUVSF༷ʑͳঢ়گɺશମͷߏ౿·ܾ͑ͯΊΔ w ϝϯόʔͱઃܭ։ൃํΛؚΊͨίϯςΩετΛڞ༗͢Δ Architecture
5IBOLZPV