Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
RailsのQueryオブジェクトとは / What is a Query Object in...
Search
K H
September 12, 2024
0
22
RailsのQueryオブジェクトとは / What is a Query Object in Rails?
K H
September 12, 2024
Tweet
Share
More Decks by K H
See All by K H
ファシリテーションテクニック / facilitation technic
kengohayata
0
12
SQLの実行計画とは / What is an SQL execution plan
kengohayata
0
23
Ruby Silverを取得してみた / get ruby silver
kengohayata
0
20
Ruby と Rails のざっくりとした Cookie の扱い方 / use cookie for ruby and rails
kengohayata
0
54
【LT会】進数を学ぼう! / study base number
kengohayata
0
16
【LT会】睡眠テクニックを身につける / study sleep technique
kengohayata
0
63
エンジニア座談会告知
kengohayata
0
60
未経験転職エンジニア座談会資料
kengohayata
0
59
Featured
See All Featured
Docker and Python
trallard
47
3.7k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.3k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.3k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.5k
Optimising Largest Contentful Paint
csswizardry
37
3.5k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
1k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.7k
Java REST API Framework Comparison - PWX 2021
mraible
34
9k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.1k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
Rails Girls Zürich Keynote
gr2m
95
14k
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をできる限り 削除したらしい
他のデザインパターンも学習するぞ