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
26
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
13
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
56
【LT会】進数を学ぼう! / study base number
kengohayata
0
16
【LT会】睡眠テクニックを身につける / study sleep technique
kengohayata
0
64
エンジニア座談会告知
kengohayata
0
64
未経験転職エンジニア座談会資料
kengohayata
0
60
Featured
See All Featured
Navigating Team Friction
lara
192
16k
GraphQLとの向き合い方2022年版
quramy
50
14k
Designing for Performance
lara
611
70k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
The Curse of the Amulet
leimatthew05
1
9.5k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
80
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
130
Docker and Python
trallard
47
3.8k
The SEO Collaboration Effect
kristinabergwall1
0
380
Building the Perfect Custom Keyboard
takai
2
710
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.4k
The browser strikes back
jonoalderson
0
760
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をできる限り 削除したらしい
他のデザインパターンも学習するぞ