Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
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
16
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
11
SQLの実行計画とは / What is an SQL execution plan
kengohayata
0
17
Ruby Silverを取得してみた / get ruby silver
kengohayata
0
17
Ruby と Rails のざっくりとした Cookie の扱い方 / use cookie for ruby and rails
kengohayata
0
43
【LT会】進数を学ぼう! / study base number
kengohayata
0
14
【LT会】睡眠テクニックを身につける / study sleep technique
kengohayata
0
60
エンジニア座談会告知
kengohayata
0
55
未経験転職エンジニア座談会資料
kengohayata
0
57
Featured
See All Featured
How to train your dragon (web standard)
notwaldorf
94
6.1k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3.1k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Writing Fast Ruby
sferik
628
62k
Visualization
eitanlees
146
16k
Gamification - CAS2011
davidbonilla
81
5.3k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
Embracing the Ebb and Flow
colly
86
4.7k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.4k
Documentation Writing (for coders)
carmenintech
72
4.9k
The Cult of Friendly URLs
andyhume
79
6.5k
Facilitating Awesome Meetings
lara
54
6.4k
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をできる限り 削除したらしい
他のデザインパターンも学習するぞ