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
Off the Rails: Patterns for fixing fat models, ...
Search
Alexander Clark
April 23, 2019
Technology
390
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Off the Rails: Patterns for fixing fat models, out-of-controllers, and other Rails problems
Alexander Clark
April 23, 2019
More Decks by Alexander Clark
See All by Alexander Clark
Docker: What It Is and Why You Should Care
alexanderclark
0
410
Building with Rack
alexanderclark
2
400
Other Decks in Technology
See All in Technology
実践! SRE × AI - ABEMA における AIOps -
tetsuya28
7
1.8k
自分で立ててみるLLMサービス
y_sera15
0
150
自作バイナリを動かす「入口」8選
puhitaku
1
1.1k
Datadog の学び方 - あるいは、オブザーバビリティを学ぶとは何か
mananyuki
1
500
UniFi(ユニファイ)AIカメラの現場活用
ludicmind
1
290
Deep Data Security 機能解説
oracle4engineer
PRO
2
730
今さら理解するウェブフォントver.2026
takanorip
3
410
Codex概要
ymiya55
0
470
私の推しは「聞いてから進む」AIです -AI-DLCに一人でアプリを作らせた話
yama3133
1
180
AI時代に必要な脅威モデリング― 変化の速度に負けない理解とリスク判断
masakane55
5
1.2k
go-sqletch
moznion
0
110
転んだ話が背中を預ける理由になる / A_story_about_falling_down_gives_you_a_reason_to_watch_each_other_s_backs.pdf
pauli
3
330
Featured
See All Featured
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.7k
Site-Speed That Sticks
csswizardry
13
1.6k
How to build a perfect <img>
jonoalderson
1
6.1k
[SF Ruby Conf 2025] Rails X
palkan
3
1.4k
Done Done
chrislema
187
17k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
350
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
450
Music & Morning Musume
bryan
48
7.4k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
340
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
920
Transcript
Off the Rails Patterns for fixing fat models, out-of-controllers, and
other Rails problems
What I’m about to tell you is wrong.
YMMV
MVC
View Controller Model
3 Tier Architecture
Business Logic Presentation Data
Business Logic Presentation Data
Business Logic Presentation Data View Controller Model
Business Logic Presentation Data View Controller Model
View Controller Model Business Logic Presentation Data
None
None
None
View Controller Model
Model Service View Controller
Business Logic Presentation Data
Business Logic Presentation Data
Business Logic Presentation Data Service
None
None
Controller Rule of Thumb A Controller May Contain: • Public
REST methods • Private before_action setters • Private strong params method
Models
Business Logic Presentation Data View Controller Model
Business Logic Presentation Data View Controller Model
Business Logic Presentation Data View Controller Model Repository
None
Business Logic Presentation Data View Controller Validator Model
None
None
None
None
–Sandi Metz “duplication is far cheaper than the wrong abstraction”
YAGNI
Bonus Tip
None
None
Thanks for Listening Alexander Clark atheclark alexander-clark.com alexander-clark
Further reading • https://codeclimate.com/blog/7-ways-to-decompose-fat- activerecord-models/ • Patterns of Enterprise Application
Architecture (Fowler) • Domain Driven Design (Evans) • All the Little Things (Metz) https://www.youtube.com/ watch?v=8bZh5LMaSmE • Ruby Object Mapper https://rom-rb.org/
Questions?