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
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
[GoCon2026] When Goroutines Are Not Enough: Runtime Locality in High-Throughput Go
takehaya
6
2.3k
What We Talk About When We Talk About XP
m_seki
2
630
世界の中心で、AI(App Intents)をさけぶ ー App Intents中心設計の実践ガイド
touyou
0
580
AHC070解法紹介
eijirou
0
120
thread_parallel_with_free-threaded_Python_and_NumPy.pdf
riku_sakamoto
0
330
そのリトライ、死んだコネクションを使い回していませんか ── GoのHTTPクライアントとHTTP/2を実プロダクト障害から学び直す
myus4a
0
140
Family mrubyの進捗
kishima
1
120
Vue Fes Japan 2026 タイムテーブル徹底解説
448jp
1
200
SONY CISC-NEWS NWS-1750 + NWB-225 フレームバッファの NetBSD/news68k ドライバ実装 / OSC2026Hiroshima
tsutsui
0
110
wkhtmltopdfの次どうするか問題2026
willnet
1
120
LoopHub - ローカルで動く GitHub で、AI と共同開発
jugyo
1
550
From 6 People Classroom Meetup to 100 People Regional Conference / FOSS4G Hiroshima 2026
furukawayasuto
0
200
Featured
See All Featured
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.4k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
610
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
330
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
330
Embracing the Ebb and Flow
colly
88
5.2k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
910
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
450
Abbi's Birthday
coloredviolet
4
10k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
4.8k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
290
Navigating Team Friction
lara
192
16k
How to make the Groovebox
asonas
2
2.4k
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ίϯςφͰΠϯελϯεͷΓସ༷͑ͯมߋʹର ԠͰ͖Δ
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ