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

入門 境界づけられたコンテキスト

入門 境界づけられたコンテキスト

phperkaigi 2022の資料です。
理解しながら共通化するところはするなどいいバランスを心がけましょう。
音声が悪いですが資料だけでなく、トーク内容も併せて・・!

yuuki takezawa

April 11, 2022
Tweet

More Decks by yuuki takezawa

Other Decks in Technology

Transcript

  1. 1SP fi MF  • ஛ᖒ༗وBLBZUBLF • ελʔϑΣεςΟόϧגࣜձࣾଞ਺ࣾ • ετϦʔϜॲཧɺσʔλج൫తͳ͜ͱɺ1E.ͳͲ

    • UXJUUFSIUUQTUXJUUFSDPNFY@UBLF[BXB • GBDFCPPLIUUQTXXXGBDFCPPLDPNZVVLJUBLF[BXB • HJUIVCIUUQTHJUIVCDPNZUBLF
  2. ໊دͤͷೝࣝ ΤϯδχΞ  • ৯ྉ඼໊ • ϝʔΧʔ໊ • ೖྗ࣌ͷ৯ྉ඼ •

    ໊د࣮ͤࢪ೔ͱϑϥά • ໊دͤ࣌ʹݩͷ৯ྉ඼໊*%Λ࣋ͨͤΔ • ৽͍͠৯ྉ඼໊*%Λ෇༩
  3. ϨϏϡʔଅਐࢪࡦͷೝࣝ  • ৯ྉ඼໊ • ϝʔΧʔ໊ • δϟϯϧ • ϨϏϡʔจ

    • ϨϏϡϫʔʢ౤ߘऀʣ • ఺਺ • ฏۉ఺ • ฒͼॱ
  4. ϨϏϡʔଅਐࢪࡦͷೝࣝ ΤϯδχΞ  • ಉ͡৯ྉ඼ͩ͠ɺ 
 ίʔυ͸ಉ༷ʹڞ௨Խ͓ͤͯ͜͞͏ • ϨϏϡʔͱ͔ͷ࣋ͨͤํ͕ͪΐͬͱมΘ͖ͬͯͨͳ͊ 


    ςʔϒϧΛͦΖͦΖ෼ׂ͢Δ͔ʔ 
 ͜ͷฏۉ఺͸ݕࡧʹ͔͠࢖Θͳ͍͚Ͳɺ͜͜ʹͳ͍ͱ 
 ද͕ࣔେมͩ͠ɺݕࡧ࣌ͷ0SEFS΋͜͜ʹͳ͍ͱҰճͰऔΕͳ͍ ͳ͊ɾɾ
  5. ௨ൢ͔ΒΈͨ৯ྉ඼ͷೝࣝ  • ৯ྉ඼໊ • ϝʔΧʔ໊ • ৯ྉ඼੒෼ • δϟϯϧ

    • ௨৴ൢചՁ֨ • ϨϏϡʔจ • ϨϏϡϫʔʢ౤ߘऀʣ • ఺਺ • ฏۉ఺ • ฒͼॱ • ഑ૹઌ • ࡏݿ؅ཧ • 4,6 • ൢചεςʔλε༗ແ • Ϩίʔυঢ়ଶ
  6.  class Product { public function __construct( private string $name,

    private string $maker, private ?DateTime $created = null, private ?User $user = null, private ?string $marketPrice = null, private ?string $originalName = null, private ?DateTime $nameIdentificationDate = null, private ?string $genre = null, private ?string $reviewBody = null, private ?User $reviewUser = null, private ?int $score = null, private ?float $avg = null, private ?int $orderNumber = null, private ?int $salePrice = null, private ?string $deliveryArea = null, private ?int $stockKeepingUnit = null, private ?int $saleStatus = null, private ?int $enabled = null ) {} }
  7. ৯ྉ඼ͱ͸ʢΤϯδχΞʣ  • ৯ྉ඼͸QSPEVDUTͱͯ͠੔උ͍ͯͨ͠ • ৯ྉ඼ʹ͸ೖྗݩͷ঎඼໊ͱਃ੥ঢ়ଶ͕͋Γɺ 
 ಉ͡Α͏ͳσʔλ͕ͲΜͲΜ࡞ΒΕ͍ͯ͘ 
 ໊دͤ͞Εͨ΋ͷ͸ਃ੥͞Ε͍ͯͳ͍͚ͲೝՄঢ়ଶͰɺ

    
 ໊دͤϑϥά͕͋Δ • ϝʔΧʔ౎߹Ͱ௨ൢͰചΕͳ͍͜ͱ͸͋Δ͕ɺ 
 ϨϏϡʔ͕͍͍ͭͯΔ΋ͷ͸දࣔ͠ͳ͚Ε͹ͳΒͳ͍ • ঎඼Ϩίʔυ͕ແޮͳͱ͖͸ͳʹΑΓ΋༏ઌͤ͞ͳ͚Ε͹ͳΒͳ͍ 
 ʢ࿦ཧ࡟আʣ
  8. ৯ྉ඼ͱ͸ʢΤϯδχΞʣ  • ৯ྉ඼͸഑ૹՄೳͳ΋ͷͰ͋Δ͔Ͳ͏͔ͷ൑ఆ͕͋Γɺ 
 Ӿཡऀͷॅॴ͔Β഑ૹ೔Λܭࢉ͢Δඞཁ͕͋Δ 
 • ݕࡧϖʔδͰ͸ฒͼॱ͕͋Γɺ 


    ଞͷϖʔδͰ͸৽͍͠঎඼ॱʹฒ͹ͤͳ͚Ε͹ͳΒͳ͍ 
 • ৯ྉ඼͸ࢢ৔ൢചՁ֨ͱɺฐࣾͰͷ௨৴ൢചՁ͕֨͋Γɺ 
 ௨৴ൢച࣌ʹ͸4,6Λߟ͑ͳ͚Ε͹ͳΒͳ͍
  9. ίϯςΩετΛཧղ͢ΔϝϦοτ  • ෺ࣄͷίϯςΩετΛཧղͯ͠ɺ੔ཧ͢Δ͜ͱͰ 
 ཱ৔ͳͲ͕ҧ͏৔߹Ͱ΋ 
 ೝࣝϨϕϧΛଗ͑Δ͜ͱ͕Ͱ͖Δ • ೝࣝͷᴥᴪͷ΄ͱΜͲ͕͜ͷίϯςΩετ͔Β͘Δ΋ͷ

    
 ίϛϡχέʔγϣϯͷվળͱཧղ౓ͷΞοϓ • ͜ͷίϯςΩετΛ͏·͘දݱ͢Δ͜ͱͰϦϑΝΫλϦϯά͸΋ͪΖΜɺ 
 ΞϓϦέʔγϣϯͱͷ޲͖߹͍ํɺෳࡶ͞ͷճආʹܨ͕Δ