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
RailsのQueryオブジェクトとは / What is a Query Object in...
Search
K H
September 12, 2024
37
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
RailsのQueryオブジェクトとは / What is a Query Object in Rails?
K H
September 12, 2024
More Decks by K H
See All by K H
ファシリテーションテクニック / facilitation technic
kengohayata
0
24
SQLの実行計画とは / What is an SQL execution plan
kengohayata
0
37
Ruby Silverを取得してみた / get ruby silver
kengohayata
0
35
Ruby と Rails のざっくりとした Cookie の扱い方 / use cookie for ruby and rails
kengohayata
0
68
【LT会】進数を学ぼう! / study base number
kengohayata
0
29
【LT会】睡眠テクニックを身につける / study sleep technique
kengohayata
0
78
エンジニア座談会告知
kengohayata
0
80
未経験転職エンジニア座談会資料
kengohayata
0
72
Featured
See All Featured
Skip the Path - Find Your Career Trail
mkilby
1
260
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
550
Test your architecture with Archunit
thirion
2
2.4k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
2
2.2k
The SEO identity crisis: Don't let AI make you average
varn
0
590
Ruling the World: When Life Gets Gamed
codingconduct
0
400
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.6k
Faster Mobile Websites
deanohume
310
32k
Leo the Paperboy
mayatellez
10
2.4k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
530
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
Transcript
Queryオブジェクトとは
・デザインパターンは、再利用可能で効率的なコード設計を行うこと Fat ModelやFat Controller等の問題を回避できる ex) Decoratorオブジェクト、Formオブジェクトなど ・ModelやControllerの検索ロジックをQueryオブジェクトに分離す
ることで、再利用性の向上と責務の分離ができる Queryオブジェクトとは? ・Railsのデザインパターンの1つ
Queryオブジェクトの例
Queryオブジェクトを駆使すれば、gemの依存関係の回避につながる ・某イケてるRailsを使ったSaaS企業では、検索機能でgemを使わず Queryオブジェクトを使っているらしい ・gemはgem同士依存してメモリ使用量などパフォーマンスに影響するし、 バージョン管理が大変 ・shopifyではボトルネックになっていた500前後のgemをできる限り 削除したらしい
他のデザインパターンも学習するぞ