Upgrade to Pro — share decks privately, control downloads, hide ads and more …

ふんわりとDDD実践してみた

3db74e9500e46d49718ae1aa835b08db?s=47 tenmihi
March 09, 2019

 ふんわりとDDD実践してみた

Fukuoka Perl Workshop #28 で発表しました

3db74e9500e46d49718ae1aa835b08db?s=128

tenmihi

March 09, 2019
Tweet

Other Decks in Programming

Transcript

  1. ;ΜΘΓͱDDD࣮ફͯ͠Έͨ Fukuoka Perl Workshop #28 - tenmihi

  2. ࣗݾ঺հ • tenmihi (ͯΜΈͻ) • גࣜձࣾϞόΠϧϑΝΫτϦʔ • Perl, JS •

    2018೥9݄͔Β௕࡚Ͱ
 ϑϧϦϞʔτͯ͠·͢
  3. ͓࿩͢Δ͜ͱ • ࠷ۙDDDΛ࣮ફͨ͠ͷͰͦΕʹ͍͓ͭͯ࿩Λ • ઓུతͳͱ͜Ζ͸ίϯςΩετਂ͗͢ΔͷͰ υϝΠϯϞσϧͷߏஙʹؔͯ͠ͷΈ৮Ε·͢

  4. ΄ͱΜͲPerlཁૉ͋Γ·ͤΜ

  5. ࣗ෼ͷόοΫάϥ΢ϯυ • ࠓ·ͰαʔϏεͷӡ༻ΛόϦόϦ΍ͬͯͨ • େ͖ΊͷઃܭʹͪΌΜͱ޲͖߹ͬͨͷ͸
 ࠓճ͕ॳΊͯ

  6. ͲΜͳϓϩδΣΫτ • طଘαʔϏεͷ؅ཧը໘ • ࣾ಺Ͱ࢖͏΋ͷͰެ։͢Δ΋ͷͰ͸ͳ͍ • ӡ༻ʹؔ͢Δಛఆͷۀ຿ϑϩʔΛࢧԉ͢Δ • 8ׂ΄Ͳ։ൃ͕ऴΘͬͯগ͠ͷظؒܦ͍ͬͯͨ

  7. ࢒Γ2ׂͷ։ൃΛߟ͕͑ͨ • ͕࣌ܦͪӡ༻νʔϜͷϝϯόʔ΋มΘͬͯ
 ۀ຿ϑϩʔ΋มΘͬͨ • ։ൃ్தͷ੒Ռ෺͸৽͍͠ۀ຿ϑϩʔʹ
 ߹Θͳ͘ͳ͍ͬͯͨ

  8. ཁ݅ͷ֬ೝɾઃܭʹ
 ཱͪ໭ͬͯ։ൃ͠௚͢͜ͱʹ

  9. DDDΛ࠾༻ͨ͠ཧ༝ • ઃܭख๏ͷதͰ͸ϝδϟʔͰྑͦ͞͏ͱ͍͏ओ؍ • ΋ͱ΋ͱ͕DDDʹ͍ۙख๏Ͱઃܭ͞Ε͍ͯͨͨΊ • ࣾ಺Ͱ΋DDDͷ࣮ફྫ͕গͳ͘ɺ࣮ફͷྑ͍ػձ
 ͩͱߟ͑ͨͨΊ

  10. ࣮ફͨ͠಺༰

  11. υϝΠϯϞσϧͷߏஙखॱ 1. ۀ຿ϑϩʔͷ֬ೝ 2. ۀ຿ͷؔ৺ࣄʹ͍ͭͯௐ΂Δ 3. νʔϜ಺ͰυϝΠϯϞσϧͷਫ਼ࠪ

  12. ۀ຿ϑϩʔͷ֬ೝ • σΟϨΫλʔͱҰॹʹۀ຿ϑϩʔΛ֬ೝ • Ҏલͷ࣮૷΋֬ೝͭͭ͠ۀ຿ϑϩʔͷมԽ΋೺Ѳ

  13. ۀ຿ͷؔ৺ࣄʹ͍ͭͯௐ΂Δ • ର৅ͱͳΔαʔϏεͷTableΛ΋ͱʹચ͍ग़͠ • ͍͘Β͔࣮૷ࡁΈͩͬͨ͜ͱ΋͋Γɺ
 ઌʹܰ͘ϞσϧΛॻ͍ͯUMLͰు͖ग़ͨ͠

  14. ۀ຿ͷؔ৺ࣄʹ͍ͭͯௐ΂Δ package Fugafuga; use Mouse; has name_en => ( isa

    => Str ); has timestamp => ( isa => Int ); has item => ( isa => PiyoPiyo ); package Piyopiyo; use Mouse; has title => ( isa => Str ); has description => ( isa => Str );
  15. νʔϜ಺ͰυϝΠϯϞσϧͷਫ਼ࠪ • ༻ޠදΛݩʹϢϏΩλεݴޠΛɺ
 ੜ੒ͨ͠UMLΛݩʹϞσϧͷؔ܎Λ֬ೝͨ͠ • νʔϜϝϯόʔ୭Ͱ΋ݟΕΔ&ߋ৽Ͱ͖Δ
 ͱ͜ΖʹυΩϡϝϯτΛஔ͍ͨ

  16. νʔϜ಺ͰυϝΠϯϞσϧͷਫ਼ࠪ

  17. ײͨ͜͡ͱ

  18. ίʔυ্Ͱͷදݱ΋ܾΊͨ͜ͱͰ
 ࣮૷্Ͱ΋දݱͷϒϨΛͳͤͨ͘ • ࣮αʔϏεͷ࣮૷Ͱͷݺͼํͱࠞͬͯ͟
 ᐆດʹͳΓͦ͏ͩͬͨͷͰΑ͔ͬͨ • ͨͩɺͲ͏ͯ͠΋ҧ࿨ײ͋ΔදݱʹͳΔ΋ ͷ΋͋Γ೰Μͩ

  19. ϞσϧΛϒϥογϡΞοϓ͠΍͍͢
 ؀ڥΛ࡞Δͷ͸ॏཁ ߋ৽͢ΔͷΊΜͲ͍͘͞ͱ͙͢͞·
 υΩϡϝϯτ͕ݹ͘ͳͬͯᴥᴪ͕ੜ͡Δ

  20. ڞ௨ͷݴޠΛܾΊͯ
 νʔϜͰ༻͍Δ͚ͩͰ΋༗ӹ DDD͡Όͳ͘ͱ΋ڞ௨ͷݴޠΛ༻͍ͯ
 ઃܭ͢Δ͜ͱ͕ઃܭख๏ͷΤοηϯεͱͯ͠
 ෯޿͘༗༻ͦ͏