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
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
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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
K H
September 12, 2024
43
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
Transcript
5 slides
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をできる限り 削除したらしい
他のデザインパターンも学習するぞ
More Decks by K H
See All by K H
ファシリテーションテクニック / facilitation technic
kengohayata
0
28
SQLの実行計画とは / What is an SQL execution plan
kengohayata
0
39
Ruby Silverを取得してみた / get ruby silver
kengohayata
0
39
Ruby と Rails のざっくりとした Cookie の扱い方 / use cookie for ruby and rails
kengohayata
0
70
【LT会】進数を学ぼう! / study base number
kengohayata
0
36
【LT会】睡眠テクニックを身につける / study sleep technique
kengohayata
0
84
エンジニア座談会告知
kengohayata
0
83
未経験転職エンジニア座談会資料
kengohayata
0
77
Featured
See All Featured
GitHub's CSS Performance
jonrohan
1033
470k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
23k
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
Automating Front-end Workflow
addyosmani
1370
210k
エンジニアに許された特別な時間の終わり
watany
109
250k
Visualization
eitanlees
153
17k
[SF Ruby Conf 2025] Rails X
palkan
3
1.6k
Are puppies a ranking factor?
jonoalderson
2
4.2k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.8k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
3k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
380
My Coaching Mixtape
mlcsv
0
400