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
23
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
55
【LT会】進数を学ぼう! / study base number
kengohayata
0
16
【LT会】睡眠テクニックを身につける / study sleep technique
kengohayata
0
63
エンジニア座談会告知
kengohayata
0
63
未経験転職エンジニア座談会資料
kengohayata
0
59
Featured
See All Featured
How to Think Like a Performance Engineer
csswizardry
28
2.4k
What's in a price? How to price your products and services
michaelherold
246
13k
How to Ace a Technical Interview
jacobian
281
24k
Getting science done with accelerated Python computing platforms
jacobtomlinson
1
96
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
52
Unsuck your backbone
ammeep
671
58k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
100
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Navigating Team Friction
lara
191
16k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.3k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
Between Models and Reality
mayunak
1
170
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をできる限り 削除したらしい
他のデザインパターンも学習するぞ