Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
RailsのQueryオブジェクトとは / What is a Query Object in...
Search
K H
September 12, 2024
35
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
22
SQLの実行計画とは / What is an SQL execution plan
kengohayata
0
33
Ruby Silverを取得してみた / get ruby silver
kengohayata
0
30
Ruby と Rails のざっくりとした Cookie の扱い方 / use cookie for ruby and rails
kengohayata
0
66
【LT会】進数を学ぼう! / study base number
kengohayata
0
26
【LT会】睡眠テクニックを身につける / study sleep technique
kengohayata
0
76
エンジニア座談会告知
kengohayata
0
78
未経験転職エンジニア座談会資料
kengohayata
0
70
Featured
See All Featured
Paper Plane (Part 1)
katiecoart
PRO
1
11k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
520
A better future with KSS
kneath
240
18k
How to Ace a Technical Interview
jacobian
281
24k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
Six Lessons from altMBA
skipperchong
29
4.5k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
970
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.4k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
340
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.6k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
370
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をできる限り 削除したらしい
他のデザインパターンも学習するぞ