Eloquentに別れを告げるタイミングについて考えた
by
y_ahiru
Link
Embed
Share
Beginning
This slide
Copy link URL
Copy link URL
Copy iframe embed code
Copy iframe embed code
Copy javascript embed code
Copy javascript embed code
Share
Tweet
Share
Tweet
Slide 1
Slide 1 text
Laravel Meetup Tokyo Vol.12 ٢ా͋ͻΔ (@strtyuu) &MPRVFOUʹผΕΛࠂ͛Δ λΠϛϯάʹ͍ͭͯߟ͑ͨ
Slide 2
Slide 2 text
ࣗݾհ ٢ా͋ͻΔ !TUSUZVV τΡΪϟολʔגࣜձࣾ 4PGUXBSF&OHJOFFS
Slide 3
Slide 3 text
$VSBUJPO$PNNVOJDBUJPO1MBUGPSN IUUQTUPHFUUFSDPN ·ͱΊΑ͏ɺ͋ͭ·Ζ͏
Slide 4
Slide 4 text
&MPRVFOU Active Record Domain Model ORM × ×
Slide 5
Slide 5 text
03. ɾ%#͔Βऔಘͨ͠ΛΦϒδΣΫτʹม͢Δͷ
Slide 6
Slide 6 text
"DUJWF3FDPSE ɾςʔϒϧɾϏϡʔͷεΩʔϚͱີ݁߹ͨ͠ϓϩύςΟ ɾϨίʔυΛΠϯελϯεԽͯ͠ৼΔ͍Λ࣋ͨͤΔ ɾυϝΠϯϞσϧͷҰछ ɾ%#ΞΫηεͷΧϓηϧԽ
Slide 7
Slide 7 text
%PNBJO.PEFM ɾυϝΠϯʹଘࡏ͢Δ֓೦ΛΫϥεԽͨ͠ͷ ɾυϝΠϯʹযΛͯͨɺ७ਮͳϩδοΫͷू·Γ
Slide 8
Slide 8 text
&MPRVFOUͷྑ͍ॴ ɾߴػೳʂ ɾָʹ։ൃ͕Ͱ͖Δʂ ɾศརͳϥΠϒϥϦͨ͘͞Μʂ
Slide 9
Slide 9 text
&MPRVFOUͷਏͦ͏ͳॴ ɾΫΤϦΛ࠷దԽ͍ͨ͠ͱ͖ ɾ3FQPTJUPSZύλʔϯͱͷ૬ੑ͕ඍົʁ ɾϑΝοτʹͳΓ͕ͪ ɾϞσϧ͕ςʔϒϧߏͱҰக͠ͳ͍ͱ͖
Slide 10
Slide 10 text
ΫΤϦͷ࠷దԽ
Slide 11
Slide 11 text
4&-&$5 '30.AQPTUTA 8)&3&AQPTUTAAJEA -*.*5 4&-&$5 '30.ADPNNFOUTA 8)&3& ADPNNFOUTAAQPTU@JEA "/%ADPNNFOUTAAQPTU@JEA*4/05/6--
Slide 12
Slide 12 text
4&-&$5 '30.AVTFSTA 8)&3&&9*454 4&-&$5 '30.AQPTUTA 8)&3& AVTFSTAAJEAAQPTUTAAVTFS@JEA
Slide 13
Slide 13 text
ɾ͍ΫΤϦ͕ు͔Εͯਏ͍ ಀ͛ಓ͕͋ΔͷͰɺผΕΛࠂ͛Δཧ༝ʹͳ Γʹ͍͘ʁ ɾ͕ڐ༰ൣғͰ͋Εແࢹ͢Δ͜ͱ ɾΫϦςΟΧϧͳॴ͚ͩී௨ʹ42-Λॻ͍ͯ ޡຐԽ͢ͱ͔ग़དྷΔ
Slide 14
Slide 14 text
Repositoryύλʔϯͱͷ ૬ੑ͕ඍົʁ
Slide 15
Slide 15 text
3FQPTJUPSZύλʔϯ ɾӬଓԽઌͱͷΓͱΓΛӅณ͢Δ
Slide 16
Slide 16 text
Slide 17
Slide 17 text
Slide 18
Slide 18 text
͑ͬ
Slide 19
Slide 19 text
ɾ&MPRVFOUͰ%#ΞΫηε͕ग़དྷΔ͍ͤͰɺ ɹ3FQPTJUPSZͷ֎ͰΫΤϦΛॻ͍ͯ͠·͏ &MPRVFOUʹผΕΛࠂ͛ΔΑΓɺίʔυϨ Ϗϡʔͱ͔ͰೝࣝΛ߹Θͤͨํ͕ྑͦ͞͏ ɾ&MPRVFOUͷ͍ͤͱ͍͏͔ɺ࣮ऀͷ
Slide 20
Slide 20 text
ϑΝοτʹͳΓ͕ͪ
Slide 21
Slide 21 text
ΈΜͳ͕&MPRVFOUʹΒͤͯ ͦ͏ͳ͜ͱ ɾ%#ͱͷΓͱΓ ɾଞͷ&MPRVFOUͱͷϦϨʔγϣϯ ɾυϝΠϯϞσϧͱͯ͠ͷৼΔ͍
Slide 22
Slide 22 text
&MPRVFOUΛϑϧ׆༻ͯ͠Δਓ ͕ͬͯͦ͏ͳ͜ͱ ɾϓϩύςΟͷόϦσʔγϣϯ ɾϓϨθϯςʔγϣϯϩδοΫ
Slide 23
Slide 23 text
※Laravel Boilerplate - https://github.com/rappasoft/laravel-5-boilerplate/blob/master/app/ Models/Auth/Traits/Attribute/UserAttribute.php ϓϩύςΟͷόϦσʔγϣϯ
Slide 24
Slide 24 text
※Laravel Boilerplate - https://github.com/rappasoft/laravel-5-boilerplate/blob/master/app/ Models/Auth/Traits/Attribute/UserAttribute.php ϓϨθϯςʔγϣϯϩδοΫ
Slide 25
Slide 25 text
ɾ&MPRVFOU͕ศར͗͢ΔͨΊʹɺ͋Ε͜ Ε&MPRVFOUʹ࣮͢Δ͜ͱͰ'BUʹͳͬͯ ͠·͏͜ͱ͕͋Δ &MPRVFOUʹผΕΛࠂ͛ͳͯ͘ɺ͝ͱ ʹΫϥεΛ͚Εই༊͑Δͣ ɾ&MPRVFOUͷ͍ͤͱ͍͏͔ɺΫϥεઃܭͷ
Slide 26
Slide 26 text
ςʔϒϧߏͱҰக͠ͳ͍ Ϟσϧ
Slide 27
Slide 27 text
" # $ % & ςʔϒϧA ςʔϒϧB ͤͳύλʔϯ Model A Model B
Slide 28
Slide 28 text
" # $ % & ςʔϒϧA ςʔϒϧB ਏ͘ͳΔύλʔϯ Model A × ×
Slide 29
Slide 29 text
ͳͥਏ͘ͳΔͷ͔ ɾ"DUJWF3FDPSEςʔϒϧɾϏϡʔͱର͕લ ఏͷσβΠϯύλʔϯ ɾKPJOલఏͷϝιου͕ଘࡏͨ͠Γ͢Δͱਏ͞ͷ ࢝·Γ ɾۀϩδοΫςʔϒϧߏͱແؔʹมԽ ͍ͯ͘͠ ɾΦϒδΣΫτϑΝʔετͳઃܭͱ૬ੑ͕ѱ͍ ɾ.Z42-ͷ7*&8*OEFYͷͱ͔͋ΔͷͰʜ
Slide 30
Slide 30 text
ɾ࠷େͷϝϦοτͰ͋Δ%#ͱີ݁߹ͳ෦ ɺಉ࣌ʹ࠷େͷσϝϦοτʹͳΓ͑Δ ७ਮͳυϝΠϯϞσϧ͕ඞཁʹͳͬͨΒɺ &MPRVFOUͱ͓ผΕ͢Δ߹ਤͳͷ͔͠Εͳ ͍ ٽ ɾ͜Ε&MPRVFOUͷຊ࣭తͳ෦ͱͷ૬ੑ ͷѱ͞
Slide 31
Slide 31 text
·ͱΊ ɾ͍͍ͩͨͷਏ͞ɺ࣮ͷͰղܾͰ͖Δͱࢥ͏ ɾ࣏҆ͷѱ͍ίʔυΛॻ͔ΕͨΒɺͪΌΜͱϨϏϡʔ Ͱ͍ͯ͜͠͏ ɾΫΤϦͷ࠷దԽ͕͖͔ͭͬͨΒ͓ผΕʹͳΔ͔͠ Εͳ͍͠ɺ·͊ͳΜͱ͔ͳΔ͔͠Εͳ͍ ɾ७ਮͳυϝΠϯϞσϧ͕ཉ͘͠ͳͬͨΒɺଟ͓ผ Ε͠ͳ͖Ό͍͚ͳ͍
Slide 32
Slide 32 text
ࢀߟࢿྉ ɾπΠολʔϥϯυͷΈͳ͞Μ ɹIUUQTUPHFUUFSDPNMJ ɾΤϯλʔϓϥΠζΞϓϦέʔγϣϯΞʔΩςΫνϟύλʔϯ ɹIUUQTXXXBNB[PODPKQEQ ɾ/&5ͷΤϯλʔϓϥΠζΞϓϦέʔγϣϯΞʔΩςΫνϟ ɹIUUQTXXXBNB[PODPKQEQ#;2;+/& ɾ-BSBWFM#PJMFSQMBUF ɹIUUQTHJUIVCDPNSBQQBTPGUMBSBWFMCPJMFSQMBUF