A Case for Use Cases
summary
Envato implements a use‑case pattern: one user action per plain Ruby classes with a shared perform entry point and ActiveModel‑based success queries, moving side‑effects into small step objects and giving controllers thin callers. An empty ActiveRecord subclass already exposes 214 methods, so moving business rules out reduces coupling, reveals features, and makes integration tests assert side effects (emails sent, sales count incremented). A local gem (interaction) and existing interactor gems show the approach works in production.
AI-written summary · about
chapters (7)
- 0:00Introduction
- 3:00New Requirements
- 6:34Definition
- 7:47Implementation
- 10:17Lessons Learned
- 13:47Use Case Patterns
- 15:38Verdict
related talks
11mUse Case Driven Development
39mExploring Rails anti-patterns
49mEnterprise Ruby - Let’s Talk Business!
36m"Business Logic in Ruby"
52mStory Driven Development: The Next Generation of Rails Functional Testing
32mN design patterns you might actually use
37mPatters to deal with big ActiveRecord models
41mAPPLICATION ARCHITECTURE: BOUNDARIES, OBJECT ROLES, & PATTERNS
