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
社内勉強会_20180418_DDD_1章
Search
RyoWATANABE
April 18, 2018
0
42
社内勉強会_20180418_DDD_1章
RyoWATANABE
April 18, 2018
Tweet
Share
More Decks by RyoWATANABE
See All by RyoWATANABE
あるあるLT_Android採用編_20191224.pdf
nabetaro_jp
0
540
developers_boost_組織とのパーフェクトマッチを目指して_201911.pdf
nabetaro_jp
0
260
あるあるLT_Android
nabetaro_jp
1
410
AndroidあるあるLT_20190122.pdf
nabetaro_jp
0
220
社内Android共有定例会資料
nabetaro_jp
0
45
社内勉強会資料_Flux
nabetaro_jp
0
89
Featured
See All Featured
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
Embracing the Ebb and Flow
colly
84
4.5k
Fireside Chat
paigeccino
34
3.1k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
28
4.4k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
It's Worth the Effort
3n
183
28k
Site-Speed That Sticks
csswizardry
2
190
Statistics for Hackers
jakevdp
796
220k
Optimising Largest Contentful Paint
csswizardry
33
3k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
3
170
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Transcript
ΤϦοΫɾΤϰΝϯζͷ υϝΠϯۦಈઃܭ ιϑτΣΞͷ֩৺ʹ͋Δෳࡶ͞ʹཱ͔ͪ͏
“͜ͷຊɺࢥྀਂ͍ιϑτΣΞ։ൃऀશһͷඞܞॻͰ͋Δɻ” Kent Beck
DDD = Domain-Driven Design (υϝΠϯۦಈઃܭʣ
DDDͱ • υϝΠϯࣝͱIT։ൃΛεϜʔζʹͭͳ͙࣮ફతࣝͷๅݿ • ݱͷͱ։ൃνʔϜͱιϑτΣΞΛͭͳ͙ڞ௨ݴޠΛ ͬ͘͡Γͱ࡞Γͳ͕Β։ൃΛਐΊ͍ͯ͘ํ๏
ίʔϯΣΠͷ๏ଇ • ιϑτΣΞͷΞʔΩςΫνϟνʔϜͷߏͱ૬ࣅܗͰ͋ Δ • ιϑτΣΞͷσβΠϯ = νʔϜͷσβΠϯ
DDDͷݪଇ • ίΞυϝΠϯʹूத͢Δࣄ • υϝΠϯͷ࣮ફऀͱιϑτΣΞͷ࣮ફऀʹΑΔతͳڞ ಉ࡞ۀΛ௨ͯ͡ɺϞσϧΛ୳ٻ͢Δࣄ • ໌ࣔతͳڥք͚ͮΒΕͨίϯςΩετͷ෦ͰɺϢϏΩλε ݴޠΛޠΔࣄ
ઃܭΛޭͤ͞Δલఏ݅ • ιϑτΣΞϓϩδΣΫτʹ͓͍ͯɺҰ൪ͷযɺυϝΠϯͱ υϝΠϯϩδοΫʹ߹Θͤͳ͚ΕͳΒͳ͍ • ෳࡶͳυϝΠϯͷઃܭɺϞσϧʹج͔ͮͳ͚ΕͳΒͳ͍ • ෳࡶͳͷυϝΠϯͦͷͷɺ͢ͳΘͪϢʔβʔͷ׆ಈϏδω εͳͷͰ͋Δ
ୈ̍෦ υϝΠϯϞσϧΛػೳͤ͞Δ
Ϟσϧͱʁ • બͼൈ͔Εͯγϯϓϧʹ͞ΕɺҙਤతʹΈཱͯΒΕͨࣝ ͷදݱํ๏
υϝΠϯϞσϧͱʁ • υϝΠϯΤΩεύʔτͷ಄ͷதʹ͋Δ୯ͳΔ͚ࣝͩͰͳ͘ɺ ͦͷ͕ࣝݫີʹߏ͞Εɺબͼൈ͔ΕͯநԽ͞Εͨ ͷ data class Servant( var id:
Long, var imageUrl: String?, var mClass: String, var rare: String, var name: String, var attr1: String, var attr2: String, var attr3: String, var targetUrl: String, var characteristic: String? )
Ϟσϧͷ༗༻ੑ • Ϟσϧͱઃܭͷ֩৺͕૬ޓʹܗ͠߹͏ • ϞσϧνʔϜϝϯόશһ͕༻͢Δݴޠͷج൫Ͱ͋Δ • Ϟσϧͱৠཹ͞ΕͨࣝͰ͋Δ
ιϑτΣΞͷ֩৺ • υϝΠϯʹؔͨ͠ΛϢʔβͷͨΊʹղܾ͢Δೳྗ • ։ൃऀυϝΠϯʹ಄͠ͳ͚ΕͳΒͳ͍ • ϞσϦϯάεΩϧΛݚ͗·͠ɺυϝΠϯઃܭʹਫ਼௨͢Δ͜ ͱ͕ཁٻ͞ΕΔ • ෳࡶ͞ʹਅਖ਼໘͔Βཱ͔ͪΘͳͯ͘ͳΒͳ͍
ͦ͏͠ͳ͚Εɺ త֎ΕͳιϑτΣΞΛ࡞ͬͯ͠·͏ةݥ͕͋Δ͔Βͩ
ୈ̍ষ ࣝΛטΈࡅ͘
ࣝͷטΈࡅ͖ • ಠΓͰߦ͏࡞ۀͰͳ͍ • ։ൃऀͱυϝΠϯΤΩεύʔτ͕ڞಉͯ͠ߦ͏
Ϟσϧͷࡐྉ • υϝΠϯΤΩεύʔτͷ಄ͷத • طଘγεςϜͷϢʔβ • ؔ࿈͢ΔϨΨγʔγεςϜ • ಉҰυϝΠϯͷผϓϩδΣΫτʹ͓͚Δٕज़νʔϜͷաڈͷ ܦݧ
ཹҙ • ࣮Λ௨ͨ͡ϑΟʔυόοΫϧʔϓʹΑͬͯϞσϧ͑Β Ε͍ͯ͘
ΥʔλʔϑΥʔϧख๏ • ϑΟʔυόοΫ͕ͳ͍ͨΊৠཹ͞Εͳ͍ • ࣝҰํʹྲྀΕΔ͚ͩͰɺੵ͞Εͳ͍
ϓϩάϥϚ͕υϝΠϯʹڵຯ͕ͳ͍ • ΞϓϦ͕ԿΛ͖͔͚ͩ͢Λௐɺͦͷഎޙʹ͋Δݪཧʹ ҙΛΘͳ͍ • ʹʼڧྗͳ৽ػೳ͕ݱΕΔͱ͍͏ஈ֊ʹɺܾͯ͠౸ୡ͢ Δ͜ͱ͕ͳ͍
υϝΠϯϞσϧΛઈ͑ͣվྑ͢Δ • ։ൃऀɺ͕ࣗྗΛି͍ͯ͠ΔϏδωεʹ͓͚Δॏཁͳݪཧ Λशಘ͢Δ͜ͱΛڧ͍ΒΕɺػցతʹػೳΛͭ͘Γͩ͢͜ͱ͕ ͳ͘ͳΔ • υϝΠϯΤΩεύʔτɺࣗͷ͍ͬͯΔ͜ͱΛৠཹͯ͠ຊ ࣭Λநग़͢ΔΑ͏ʹڧ͍ΒΕΔ͜ͱͰɺࣗͷཧղΛਫ਼៛ʢਫ਼ ີʣʹ͠ɺιϑτΣΞ͕ඞཁͳ֓೦ͷਖ਼֬͞Λཧղ͢ΔΑ͏ ʹͳΔ
• υϝΠϯΤΩεύʔτ͕Ϟσϧʹରͯ͠ใΛఏڙ͍ͯ͠Δ ͔ΒɺϞσϧʹϏδωεʹؔ͢Δਂ͍͕ࣝө͞Ε͍ͯ Δ • ʹʼͦͷந͕Ϗδωεͷਅͷݪཧͳͷͩ
Ϟσϧ͕ͨΒ͢Ըܙ • ϓϩδΣΫτΛྲྀΕଓ͚ΔใΛମܥԽ͢Δ • ཁੳͷ෭࡞༻ͱͯ͠ϓϩάϥϛϯάઃܭʹਂ͘૬ޓ࡞༻ ͢Δ • ঢ়گ͕ΑΓ໌֬ʹཧղͰ͖ΔΑ͏ʹͳΓϞσϧ͕ਫ਼៛Խ͞ΕΔ • =>ϞσϧݫີͰͳ͚ΕͳΒͳ͍
ϓϩδΣΫτʹؔ͢Δࣝʹ͍ͭͯ • ιϑτΣΞΛॻ͖࢝ΊΔͱ͖ɺզʑରΛेʹཧղ ͍ͯ͠ΔΘ͚Ͱͳ͍ • యܕతͳઃܭΞϓϩʔνͷ߹ɺίʔυͱυΩϡϝϯτ ۤ࿑ͯ͠खʹೖΕͨࣝΛՁͷܗͰදݱ͠ͳ͍ʢϞσϧͰ ͳ͍ʣ͔Βޱ಄Ͱͷঝ్͕Εͨ߹ɺࣦࣝΘΕΔ
ܧଓతֶश • ࣗͨͪͷࣝΛҙࣝతʹҭͯΔ • ։ൃऀʹͱͬͯͲΏ͜ͱ • ٕज़తͳࣝΛ্ͤ͞Δ͜ͱ • υϝΠϯʹ͍ͭͯਅʹֶश͢Δ͜ͱ
ਂ͍Ϟσϧ • ཱͭϞσϧ͕͙͢ʹݟ͔ͭΔදʹ͋Δ͜ͱΊͬͨʹ ͳ͍ • ͍͍ͨͯͷ߹ཁૉΛഇغ͢ΔɺҧͬͯࢹͰݟΔ͜ͱʹͳ Δ • ʹʼͷ֩৺Λͭ͘Α͏ͳ͏·͍ந͕ݱΕΔ
ͭͮ͘