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
Technical Leadership for Architectural Decision Making
baasie
3
460
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.9k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
67
56k
Unsuck your backbone
ammeep
672
58k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Visualization
eitanlees
152
17k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.9k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
350
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Building AI with AI
inesmontani
PRO
1
1.1k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
460
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をできる限り 削除したらしい
他のデザインパターンも学習するぞ