Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
FatControllerからの卒業
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Yuki Kitagawa
May 31, 2019
Programming
1.8k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
FatControllerからの卒業
Yuki Kitagawa
May 31, 2019
More Decks by Yuki Kitagawa
See All by Yuki Kitagawa
DockerでLaravel環境を構築する
tamayan_18
0
340
Other Decks in Programming
See All in Programming
golang-bob.pdf
iwatsukayura
0
130
Starting & Sustaining Code-Based E2E Testing for Non-Coding QA Teams( #jasstniigata )
teyamagu
PRO
1
1k
【加筆修正版】Laravel のアプリケーションをどこにデプロイするか #phpcon_ehime
akase244
0
150
TechTown - Creating Composable Callables in Contemporary C++
rollbear
0
130
Long Living Tokens, Die, Die, Die! (or: The One Ring is Banned in Modern)
sylph01
0
300
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
390
Simple Storage Service(S3) is not simple
iwatsukayura
0
290
Atomic Design, Enforced: Scaling Mobile Design Systems (next.app devCon / droidCon Berlin 2026)
steliosf
PRO
0
170
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
220
Domain-Driven Transformation
hschwentner
2
2.3k
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
28
32k
AWSに止められる覚悟してますか?
morizo_1984
2
530
Featured
See All Featured
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
280
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
It's Worth the Effort
3n
188
29k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
How Software Deployment tools have changed in the past 20 years
geshan
2
35k
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.2k
Everyday Curiosity
cassininazir
0
350
Measuring & Analyzing Core Web Vitals
bluesmoon
9
1k
Google's AI Overviews - The New Search
badams
0
1.6k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
800
How to Ace a Technical Interview
jacobian
280
24k
Mobile First: as difficult as doing things right
swwweet
225
10k
Transcript
FatController͔Βͷଔۀ
ࣗݾհ • ༤ل • σβΠϯ&ΤϯδχΞϦϯά෦ • όοΫΤϯυϞόΠϧΞϓϦΛ୲ • PHP,
Kotlin, Java, Swi6 • Reactive Extensions͕͖
εϥΠυʹग़ͯ͘Δίʔυʹ͍ͭͯ • ͜ͷεϥΠυͰɺPHPͰઆ໌Λ͍͖ͯ͠· ͢ɻ • ϑϨʔϜϫʔΫɺLaravelΛ࠾༻͍ͯ͠· ͢ɻ
ΞδΣϯμ • MVCͷ͓͞Β͍ • FatControllerͱ • FatControllerΛଔۀ͢Δ3ͭͷϙΠϯτ
MVCͷ͓͞Β͍
MVCͬͯͳΜͧʁʁʁ
MVCΞʔΩςΫνϟͱ • Model View Controllerͷུ • ΞϓϦέʔγϣϯιϑτΣΞͷ෦σʔ λΛɺϢʔβʔ͕ࢀরɾฤू͢Δใ ͔Β͢Δɻ IUUQTKBXJLJQFEJBPSHXJLJ.PEFM@7JFX@$POUSPMMFS
Model • γεςϜͷதͰϏδωεϩδοΫΛ୲ • σʔλͷΞΫηεɺσʔλͷՃΛߦ͏
View • දࣔೖग़ྗͱ͍ͬͨॲཧΛ୲ • Controller͔Βड͚औͬͨσʔλΛදࣔ͢Δ ͨΊͷ
Controller • Ϣʔβʔͷೖྗʹج͖ͮɼModelͱViewΛ੍ޚ • Model͔Βड͚औͬͨσʔλΛViewʹ͢
None
ࠓճͷςʔϚ
FatController͔Βͷଔۀ
FatControllerͱʁ
FatControllerΛॻ͍ͨ ͜ͱͳ͍ਓʙʙʙʁʁ
Θͨ͋͠Γ·͢ɻ
None
ͦ͏ɺ·͞ʹ͜ΜͳΜ
ͬͪΌ͏ؾ࣋ͪΘ͔Δ
༉அͯ͠Δͱ͜͏ͳΔ
ͱʹ͔͘ಈ͘ίʔυॻ͍ ͯͨΒ͜͏ͳͬͪΌͬͨ…
େৎɺΑ͋͘ΔͰ͢ɻ
ͳͥFatControllerʹͳΔͷ͔ • ModelϏδωεϩδοΫͰΔ͖͜ͱ ͕Controllerʹؚ·ΕΔ • Controllerͷ͕େ͖͗͢Δ
FatControllerͷμϝͳͱ͜Ζ •ίʔυ͕͘ͳΓɺՄಡੑ͕͚ܽΔ •ಉ͡Α͏ͳॲཧΛෳͷControllerʹॻ͘͜ͱʹͳΔͷͰɺ࠶ ར༻ੑ͕͚ܽΔ •νʔϜͰ։ൃ͢ΔͱɺແବͳίϯϑϦΫτ͕ى͖Δ •࣮ऀҎ֎͕खΛ͚ΒΕͳ͘ͳΓɺଐਓతͳίʔυʹͳΔ •ϝιουͷ͕େ͖͗ͯ͢ςετΛॻ͘ͷ͕༰қͰͳ͍
αϯϓϧίʔυͷ༷ • jsonΛදࣔ͢Δ͚ͩͷϖʔδΛ࡞Δ • ֎෦APIΛୟ͖ɺjsonΛड͚औΔ • ड͚औͬͨjsonCacheͱͯ͠ɺอଘ͓ͯ͘͠ • ֎෦API͔ΒjsonΛड͚औΓʹࣦഊͨ͠ΒɺCache͔Βऔ Γग़͢
Controllerʹશ෦ॻ͍ͯΈΔ
None
None
None
ʮ݅ʹΑͬͯผͷAPIΛୟ͍ͯ…ʯ Έ͍ͨͳ༷ͷՃ͕͖ͨΒਏ͘ͳ͍ʁ
FatControllerΛଔۀ 3ͭͷϙΠϯτ
3ͭͷϙΠϯτ 1. ϏδωεϩδοΫΛΫϥεʹͯؔ͠৺ࣄΛ ͤ͞Δ 2. ControllerͱϏδωεϩδοΫͷΓऔΓ ΛݮΒ͢ 3. inteIaceΛ࣮ͯ͠มߋʹڧ͘͢Δ
1. ϏδωεϩδοΫΛΫϥε ʹͯؔ͠৺ࣄΛͤ͞Δ
֎෦APIΛୟ͘
None
None
JSONΛCacheʹอଘ Cache͔ΒJSONΛऔΓग़͢
None
None
2. ControllerͱϏδωεϩδοΫͷ ΓऔΓΛݮΒ͢
ControllerͱϏδωεϩδοΫΛ հ͢ΔDataStoreΫϥεΛ࣮͢Δɻ
None
None
None
Ϋϥεͷґଘؔ
3. InteIaceΛఆٛͯ͠ มߋʹڧ͘͢Δ
None
None
None
None
DIίϯςφ
͠Cache͔DBͷͲͪΒ͔ ༷͕ܾ·Βͳ͍͚Ͳɺ։ൃ ࢭΊͳ͍ͰͱݴΘΕͨΒʁ
None
None
ΠϯελϯεΛมߋ͢Δ͚ͩ Ͱɺ༷มߋʹରԠͰ͖Δʂ
·ͱΊ • ؔ৺ࣄΛͯ͠ΫϥεͷઃܭΛ͢Δ • ControllerͱϏδωεϩδοΫͷΓऔΓΛݮΒ͢ • InteIaceΛఆٛͯ͠มߋʹڧ͘͢Δ • DIίϯςφͰΠϯελϯεͷΓସ༷͑ͯมߋʹର ԠͰ͖Δ
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ