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
33
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
RailsのQueryオブジェクトとは / What is a Query Object in Rails?
K H
September 12, 2024
More Decks by K H
See All by K H
ファシリテーションテクニック / facilitation technic
kengohayata
0
21
SQLの実行計画とは / What is an SQL execution plan
kengohayata
0
29
Ruby Silverを取得してみた / get ruby silver
kengohayata
0
28
Ruby と Rails のざっくりとした Cookie の扱い方 / use cookie for ruby and rails
kengohayata
0
64
【LT会】進数を学ぼう! / study base number
kengohayata
0
24
【LT会】睡眠テクニックを身につける / study sleep technique
kengohayata
0
75
エンジニア座談会告知
kengohayata
0
75
未経験転職エンジニア座談会資料
kengohayata
0
66
Featured
See All Featured
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
430
Designing for Timeless Needs
cassininazir
1
430
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.3k
How to Ace a Technical Interview
jacobian
281
24k
How to train your dragon (web standard)
notwaldorf
97
6.7k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.1k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
66
57k
The SEO identity crisis: Don't let AI make you average
varn
0
520
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
1k
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をできる限り 削除したらしい
他のデザインパターンも学習するぞ