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
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.1k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
320
Building the Perfect Custom Keyboard
takai
2
690
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.2k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
350
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
180
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
57
50k
AI: The stuff that nobody shows you
jnunemaker
PRO
2
270
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
380
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
120
Accessibility Awareness
sabderemane
0
54
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をできる限り 削除したらしい
他のデザインパターンも学習するぞ