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
24
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
64
エンジニア座談会告知
kengohayata
0
63
未経験転職エンジニア座談会資料
kengohayata
0
60
Featured
See All Featured
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
350
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
110
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
200
Information Architects: The Missing Link in Design Systems
soysaucechin
0
780
Navigating Weather and Climate Data
rabernat
0
110
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.9k
Scaling GitHub
holman
464
140k
A Soul's Torment
seathinner
5
2.3k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.2k
Discover your Explorer Soul
emna__ayadi
2
1.1k
Designing for humans not robots
tammielis
254
26k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
1
56
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をできる限り 削除したらしい
他のデザインパターンも学習するぞ