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
普段使いのDDD
Search
haljik
June 24, 2017
Programming
21
9k
普段使いのDDD
#KanJavaPartyA2
haljik
June 24, 2017
Tweet
Share
More Decks by haljik
See All by haljik
develop-with-domain-expert
haljik
1
1k
ドメイン駆動設計の紹介
haljik
0
80
Isolating-the-domainの紹介
haljik
3
1.6k
実録Spring MVC
haljik
10
4.7k
ドメイン駆動設計を軽快に実践するための工夫
haljik
22
7.5k
Other Decks in Programming
See All in Programming
型付き API リクエストを実現するいくつかの手法とその選択 / Typed API Request
euxn23
8
2.2k
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
120
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
1.1k
flutterkaigi_2024.pdf
kyoheig3
0
150
EMになってからチームの成果を最大化するために取り組んだこと/ Maximize team performance as EM
nashiusagi
0
100
Kaigi on Rails 2024 〜運営の裏側〜
krpk1900
1
230
cmp.Or に感動した
otakakot
3
200
TypeScriptでライブラリとの依存を限定的にする方法
tutinoko
3
690
GitHub Actionsのキャッシュと手を挙げることの大切さとそれに必要なこと
satoshi256kbyte
5
430
A Journey of Contribution and Collaboration in Open Source
ivargrimstad
0
960
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
1
100
OnlineTestConf: Test Automation Friend or Foe
maaretp
0
110
Featured
See All Featured
Optimizing for Happiness
mojombo
376
70k
Making the Leap to Tech Lead
cromwellryan
133
8.9k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
A designer walks into a library…
pauljervisheath
204
24k
Six Lessons from altMBA
skipperchong
27
3.5k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
506
140k
A Tale of Four Properties
chriscoyier
156
23k
Building Adaptive Systems
keathley
38
2.3k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.2k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Adopting Sorbet at Scale
ufuk
73
9.1k
Producing Creativity
orderedlist
PRO
341
39k
Transcript
ීஈ͍ͷ%%% ,"/+"7"1"35: !IBMKJL
ࣗݾհ w 5XJUUFS!IBMKJL w ໊લɿՏ্࢘ʢ͔Θ͔Έ͍ͤ͡ʣ w ϑϦʔϥϯεͷ+BWBϓϩάϥϚ w ؔ%%%KBWBओ࠵
͜ͷࢿྉʹ͍ͭͯ w ࢲ͕ৗࠒ͔ΒυϝΠϯۦಈઃܭʹ͍ͭͯߟ͍͑ͯ ΔࣄΛݴޠԽͨ͠ͷͰɺͦΕҎ্ͷͷͰ͋Γ ·ͤΜ w +BWB͕લఏͰ͋Γ·͕͋͢·Γ+BWBͷ͠· ͤΜ w ΦϒδΣΫτࢦͰ͢
w ϚΠΫϩαʔϏεͱ͔$234ͱ͔ͷ͋Γ·ͤΜ
ࠓ͢ࣄ w υϝΠϯۦಈઃܭ͕ඪͱ͍ͯ͠Δ͜ͱ w υϝΠϯۦಈઃܭ͕લఏͱ͍ͯ͠Δ͜ͱ w ʮυϝΠϯͰۦಈ͢Δʯͱ͍͏͜ͱͷ࣮ࡍ w νʔϜͰڞ༗͓ͯ͘͜͠ͱ w
࣮ࡍʹײͨ͡ޮՌ w ʮීஈ͍ʯͱ͍͏͜ͱ
υϝΠϯۦಈઃܭ͕ඪ ͱ͍ͯ͠Δ͜ͱ
ॊೈͰ֦ுੑʹΜͩ ιϑτΣΞ
मਖ਼֦ு͕ࠔʹͳͬͯ ͠·ͬͨ߹ࣦഊ
Ͳ͏ͳ͍ͬͯΕྑ͍͔ʁ ར༻ऀ͕ʮ͜͜ʯΛʮ͜͏ʯ͍ͨ͠ͱ͍ ͏ཁʹରͯ͠ɺʮ͜͜ʯΛʮ͜͏ʯ͢ Δ͚ͩͰมߋͰ͖ΔΑ͏ʹͳ͍ͬͯΕ ྑͦ͞͏
υϝΠϯۦಈઃܭ͕લఏ ͱ͍ͯ͠Δͷ
։ൃνʔϜ͕ར༻ऀͷ׆ಈʹؔ͢Δ ࣝମܥΛഎෛ͍ࠐΉ͜ͱ w ୯ͳΔࣝͰͳ͘ମܥ CPEZPGLOPXMFEHF˞ w ͨͩΔ͚ͩͰͳ͘എෛࠐΉ CSJOHUPCFBS˞ ˞&SJD&WBOT
%PNBJO%SJWFO%FTJHO "EEJTPO8FTMFZ1SPGFTTJPOBM൛ ୈ̍෦ͷং൫
ۀ͠ͳ͍ w ੳɾઃܭऀͱϓϩάϥϚΛ͚ͳ͍ ༁ͤͣؔ৺ࣄͱϓϩάϥϜͷ୯ҐΛҰகͤ͞Δ w Ϟσϧͷ࡞ऀͱϞσϧͷར༻ऀΛ͚ͳ͍ ϞσϧͱͦΕΛར༻͢ΔଆͷίʔυɺϞσϧʹ৽ ͨͳ͕ࣝΓࠐ·ΕΔʹมߋ͞ΕΔ
ΠςϨʔςΟϒͳϓϩηε w Ϟσϧ։ൃऀͷࣝͱͱʹ͢Δ w ͪΐͬͱ໊ͨ͠લมߋͰ͢ΒϞσϧΛར༻͢Δଆͷ ίʔυʹٴ͢Δ w ϓϩάϥϛϯάͷϓϥοτϑΥʔϜʹΑΔ੍ͷΑ ͏ͳͷવϞσϧʹϑΟʔυόοΫ͕͔͔Δ w
ͦ͏Ͱͳ͍ͱ࣮༻ੑͷͳ͍ϞσϧʹͳΔ
ʮυϝΠϯͰۦಈ͢Δʯ ͱ͍͏͜ͱͷ࣮ࡍ
ར༻ऀͷؔ৺ࣄυϝΠϯ
ར༻ऀͷ͍͏ʮ͜͜ʯΛ͜͏ ͍ͨ͠ͷʮ͜͜ʯ͕ίʔυ ্ͷͲ͜Λࢦ͢ͷ͔ʁ
ར༻ऀͷؔ৺ࣄͱҧ͏୯ҐͰ ϓϩάϥϛϯάͯ͠͠·͏ͱม ߋͷӨڹൣғ༧Ͱ͖ͳ͍
ڞ௨Խͱ͔
աͳநԽͱ͔
ٕज़ۦಈͱ͔
ը໘ۦಈͱ͔
͍Ζ͍Ζ͋Δ͚Ͳ ༧֎ͷӨڹ༧֎ͷί ετʹͳΓൃలΛ્͢Δ
͔ͩΒ
ར༻ऀͷؔ৺ࣄʹϓϩάϥϛϯάͷجຊ ୯ҐΛ͋ΘͤΔ ؔ৺ࣄͷ୯ҐͰஅɺՃϩδοΫΛ࣋ ͪɺͦΕΒͷϩδοΫʹۦಈ͞ΕΔιϑ τΣΞʹ͢Δ
υϝΠϯϞσϧʹۦಈ͞Ε ΔΞϓϦέʔγϣϯΛ࡞Δ
υϝΠϯϞσϧͰۦಈ͞ΕΔ ΞϓϦέʔγϣϯΛ࡞Δʹ υϝΠϯϞσϧ͕࣋ͭஅɺՃϩδοΫʹରͯ͋͠ ΒΏΔͱ͜Ζ͔ΒΞΫηεͰ͖ΔΑ͏ͳΞʔΩςΫνϟ Λ࠾༻͠ɺυϝΠϯϞσϧʹஅɺՃϩδοΫΛू ΊΔඞཁ͕͋Δ
νʔϜͰڞ༗͓ͯ͘͜͠ͱ
w ڥք͚ͮΒΕͨίϯςΩετ w ίϯςΩετͷ֓ཁϞσϦϯά w ϓϩάϥϛϯά্ͷݪଇ νʔϜͰڞ༗͓ͯ͘͜͠ͱ
ڥք͚ΒΕͨίϯςΩετ νʔϜͰڞ༗͓ͯ͘͜͠ͱ
ڥք͚ͮΒΕͨίϯςΩετ w ίϯςΩετʹࢹ࠲ ݻ༗໊ࢺҎ֎·ͣࢹ࠲Λ֫ಘ͠ͳ͍ͱ໊લ͕ܾ·Βͳ͍ w ࢹ࠲ͱγεςϜར༻ऀͱར༻తͷʮΈ߹Θͤʯ ྫʣస৬αΠτɿʮاۀ͕ࣗࣾʹ͋ͬͨࣾһΛ୳͢ҝʯʮٻ৬ ऀ͕ࣗʹ͋ͬͨస৬ઌاۀΛ୳͢ҝʯͳͲͳͲ w ࢹ࠲͝ͱʹϞσϦϯάͷ໊લۭؒΛ͚ͯɺͦͷࢹ࠲͔ΒΈͨ
Ϟσϧͷಋग़ʹूத͢ΔʹίϯςΩετʹಛԽ͢Δ ྫʣస৬αΠτɿʮاۀʯͱʮٻ৬ऀʯͱ͍͏໊લۭؒʹ͚ Δ νʔϜͰڞ༗͓ͯ͘͜͠ͱ
ࢹ࠲ͰࣝΛཧ ࢹ࠲͕ίϯςΩετʹͳΔ νʔϜͰڞ༗͓ͯ͘͜͠ͱ
ࢹ࠲ͷݟ͚ͭํ w ࡞Ζ͏ͱ͍ͯ͠ΔαʔϏεγεςϜͷར༻ऀΛચ ͍ग़͢ ਓͷׂͩͬͨΓγεςϜͩͬͨΓ͢Δ w ͦΕͧΕͷར༻ऀ͕ԿΛతʹͦͷγεςϜΛ͏ ͷ͔Λ໌֬ʹ͢Δ w
త͕ҧ͏ͳΒผͷࢹ࠲ w త͕ಉ͡ͳΒಉ͡ࢹ࠲ʢ͔ʣ νʔϜͰڞ༗͓ͯ͘͜͠ͱ
ίϯςΩετͷ֓ཁϞσϦϯά νʔϜͰڞ༗͓ͯ͘͜͠ͱ
w ਓɺɺࣄੳ w ࣌ܥྻੳ νʔϜͰڞ༗͓ͯ͘͜͠ͱ
ਓɾɾࣄੳ ਓٻ৬ऀɺձһɺاۀͷ୲ऀ ٻਓɺاۀ ࣄݕࡧɺԠืɺεΧτ ྫɿٻਓαΠτͷٻ৬ऀΛࢹ࠲ʹͨ͠߹ νʔϜͰڞ༗͓ͯ͘͜͠ͱ
࣌ܥྻੳ ٻ৬ऀɺاۀ͕ಠཱͯ͠·ͣ͋Δ ٻ৬ऀ͕ձһొΛ͓͜ͳ͍ձһʹͳΔ اۀ͕ٻਓΛొ͢Δ اۀ͕ٻਓΛఴͨ͠εΧτΛձһʹૹΔ
ձһاۀ͔ΒεΧτΛड͚ͱΔ ձһεΧτʹԠื͢Δ ͳͲಠཱͯ͋͠ΔਓΛ·ͣฒͦΕΒ͕ى͜͢ओཁͳΠϕϯτΛ࣌ܥྻʹฒΔ ྫɿٻਓαΠτͷٻ৬ऀΛࢹ࠲ʹͨ͠߹ νʔϜͰڞ༗͓ͯ͘͜͠ͱ
ϞσϧԽͨ͠ͷ ਓɺɺࣄੳͰग़ͨཁૉΛ࣌ ܥྻੳͰ͚ؔ͠ɺґଘͷ ํΛܾΊͨঢ়ଶ νʔϜͰڞ༗͓ͯ͘͜͠ͱ
ϞσϧΛίʔυͰ ͜ͷϨϕϧͰϞσϧͷτοϓϨϕϧύοέʔδ ͷߏͰදݱ͢Δ EPNBJONPEFM DBOEJEBUF ٻ৬ऀ DPNQBOZ اۀ
P⒎FS ٻਓ NFNCFS ձһ TDPVU εΧτ BQQMJDBUJPO Ԡื ύοέʔδؒͷґଘํͦͷ··෦ͷΦϒδΣ Ϋτ͕ύοέʔδΛލ͙ࡍͷґଘํʹ͢Δ νʔϜͰڞ༗͓ͯ͘͜͠ͱ
ϙΠϯτ w ࢹ࠲Λ֫ಘ͢Δ͜ͱͰɺͦͷࢹ࠲͔ΒΈͯෆཁͳ ͷΛ͗མͱ͠ɺॏཁͳͷΛڧௐ͢Δ w ࣌ܥྻͰચ͍ग़͢ґଘͷํॏཁͳͷ ͋ΔλΠϛϯάͰଘࡏ͠ͳ͍ͷࢀরͰ͖ͳ͍ͷ Ͱ͜ΕΛ่͢ͱ࣋ͬͯΔ͔͍࣋ͬͯͳ͍͔ͱ͍͏ঢ় ଶ͕૿͑ͯෳࡶ͕Ճ
νʔϜͰڞ༗͓ͯ͘͜͠ͱ
ϓϩάϥϛϯά্ͷݪଇ νʔϜͰڞ༗͓ͯ͘͜͠ͱ
ϓϩάϥϛϯά্ͷݪଇ w ΞʔΩςΫνϟ w ϦϑΝΫλϦϯά w υϝΠϯΦϒδΣΫτͷίʔυ w Ϟσϧͷࣗಈςετ w
+BWBͷجຊతͳ͜ͱ w ΦϒδΣΫτࢦ νʔϜͰڞ༗͓ͯ͘͜͠ͱ
ΞʔΩςΫνϟ ̏ʴυϝΠϯϞσϧ νʔϜͰڞ༗͓ͯ͘͜͠ͱ
̏ υϝΠϯϞσϧ νʔϜͰڞ༗͓ͯ͘͜͠ͱ
w υϝΠϯʹଞͷ͕̏ґଘ͍ͯ͠Δҙຯ υϝΠϯ͕શͯΛ੍ޚ͢Δҝ υϝΠϯʹϩδοΫΛूΊΔҝ w ϓϨθϯςʔγϣϯ ը໘ભҠΞϓϦέʔγϣϯͷݺͼग़͠ʹప͢Δ w ΞϓϦέʔγϣϯ υϝΠϯΦϒδΣΫτͷૢ࡞ͱ
ΠϯϑϥετϥΫνϟͷݺͼग़͠ʹప͢Δ w ΠϯϑϥετϥΫνϟ υϝΠϯͰఆٛ͞ΕΔϦϙδτϦΠϯλʔϑΣʔεͷ࣮Λஔ͘ 3%#,74ͷૢ࡞ɺଞ"1*ͷݺͼग़͠ͳͲɺར༻ऀͷؔ৺ࣄΑΓ நͷ͍ͷΛஔ͘ νʔϜͰڞ༗͓ͯ͘͜͠ͱ
w ಉ࢜ͷґଘؔ ্͔ΒԼʹର͢Δݺͼग़͠0, Լ͔Β্ʹର͢Δݺͼग़͠/( w υϝΠϯͷू୯ҐͰϦϙδτϦΛ࡞Δ w ϦϙδτϦΛܦ༝͠ͳ͍ͰଞͷूΛऔಘ͠ͳ͍ w ϦϙδτϦ͔ΒϦϙδτϦͷݺͼग़͠ɺυϝΠ
ϯͷτοϓϨϕϧύοέʔδͷґଘؔΛकΔ νʔϜͰڞ༗͓ͯ͘͜͠ͱ
ϦϑΝΫλϦϯά νʔϜͰڞ༗͓ͯ͘͜͠ͱ
w ৗʹϦϑΝΫλϦϯά͢Δ w ϘʔΠεΧτϧʔϧ खΛೖΕΔ࣌ʮདྷͨ࣌ΑΓඒ͘͠ʯ w ʮ͍ࠐΜͩάϩʔϒʯ &SJD&WBOTΤϦοΫɾΤϰΝϯεͷυϝΠϯۦಈઃܭ ୈ෦ਂ͍Ϟσϧ͠ͳ͔ͳઃܭ
ϦϑΝΫλϦϯάʹΑΓྑ͘มߋ͞ΕΔॴ͕ࣗવͱॊೈͳߏʹͳΔ w ӅΕ͍ͯΔ֓೦Λ୳͢ &SJD&WBOTΤϦοΫɾΤϰΝϯεͷυϝΠϯۦಈઃܭ ষ҉తͳ֓೦Λ໌ࣔతʹ͢Δ νʔϜͰڞ༗͓ͯ͘͜͠ͱ
υϝΠϯΦϒδΣΫτͷίʔυ νʔϜͰڞ༗͓ͯ͘͜͠ͱ
HFUUFS w ΦϒδΣΫτʹࣄΛͤ͞ΔͨΊʹɺॻ͔ͳ͍ w ෦ϑΟʔϧυͷ͕ݟͨ͘ͳͬͨΒɺͦͷʮϑΟʔ ϧυΛ͏ϩδοΫΛͦͷΦϒδΣΫτࣗʹ࣋ ͨͤΒΕͳ͍͔ʯΛߟ͑Δ νʔϜͰڞ༗͓ͯ͘͜͠ͱ
ίϯετϥΫλ w جຊతʹؔ৺ࣄͷ֎ͳͷͰԼʹ͍Δ w ΦϒδΣΫτͷओϑΟʔϧυͱɺͦΕΛͬͯ ՃɺஅΛߦ͏ϩδοΫΛ࣋ͭϝιου w ҙਤͷද໌ϑΝΫτϦϝιουͰ νʔϜͰڞ༗͓ͯ͘͜͠ͱ
ࣗಈςετ νʔϜͰڞ༗͓ͯ͘͜͠ͱ
Ϟσϧͷࣗಈςετ w ࠷ॳʹܕͷੈքͰղܾͰ͖ͳ͍͔Λߟ͑Δ w ࣍ʹߏͰղܾͰ͖ͳ͍͔Λߟ͑Δ w Ͳ͏͠Α͏ͳ͍߹ςετΛॻ͘ جຊతʹॻ͔ͳ͍ νʔϜͰڞ༗͓ͯ͘͜͠ͱ
+BWBͷجຊతͳࣄ νʔϜͰڞ༗͓ͯ͘͜͠ͱ
DDD@F;ͭ͏ͷ+BWBίʔσΟϯάͰݕࡧ JSPG͞ΜͷࢿྉΛݟ͍ͯͩ͘͞ νʔϜͰڞ༗͓ͯ͘͜͠ͱ
ΦϒδΣΫτࢦ νʔϜͰڞ༗͓ͯ͘͜͠ͱ
͜Μͳຊ͕݄ʹ ग़·͢ɻ ಡॻձ͍ͨ͠ IUUQHJIZPKQCPPL νʔϜͰڞ༗͓ͯ͘͜͠ͱ
ීஈ͍ͷҙຯ
w গͳ͘ͱࢲීஈ͔Β͍ͬͯͳ͍͜ͱΛෳࡶͳ ͷΛݟ͚ͭͨͱ͖͚ͩʹग़དྷΔͱࢥ͑ͳ͍ w খͯ͘͞୯७ͳ։ൃͰࣝͷ֬ೝɾੳɾϓϩά ϥϛϯάͷαΠΫϧΛීஈ͔ΒԿճ͢ w ͍ͭͰͲΜͳ࣌ͰͰ͖ΔΑ͏ʹجຊΛ܁Γฦ͠ ͯ࠷࣭Λఈ্͓͛ͯ͘͠