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
Queryオブジェクトとは / What is a Query Object in Rails?
Search
KH
September 12, 2024
21
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Queryオブジェクトとは / What is a Query Object in Rails?
KH
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 KH
See All by KH
ファシリテーションテクニック / facilitation technic
kh777
0
20
Ruby Silverを取得してみた
kh777
0
48
Ruby と Rails のざっくりとした Cookie の扱い方
kh777
0
21
進数を学ぼう!(Rubyの事例)
kh777
0
65
睡眠テクニックを身につける / sleep-technique
kh777
0
74
Featured
See All Featured
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Raft: Consensus for Rubyists
vanstee
143
7.9k
Believing is Seeing
oripsolob
1
290
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Utilizing Notion as your number one productivity tool
mfonobong
4
650
Test your architecture with Archunit
thirion
2
2.5k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.4k
Design in an AI World
tapps
1
400
Are puppies a ranking factor?
jonoalderson
2
4.2k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k