Missing Guide to Service Objects in Rails
summary
Argues that service objects must show the actual sequence of steps and tradeoffs not just a label, demonstrating an OO OrderCreator class versus a functional organizer built with light-service and discrete actions, showing how the functional flow composes, supports fail and return without raising slow exceptions, and makes error handling via throw/catch clearer. Examples build a create-order pipeline that runs and reports success or structured failure, with performance and composability compared.
AI-written summary · about
chapters (9)
- 0:00Start
- 4:01REAL Rails Code
- 4:26Put it in a model? Same Problem
- 17:14Functional Version continued
- 20:39Nested Conditionals
- 21:29Raising Exceptions
- 23:13Throw and Catch
- 26:41True/False
- 28:32Custom Classes
related talks
30mYour Service Layer Needn't be Fancy, It Just Needs to Exist
25mCarriers, Services and views on a diet
36mIn Relentless Pursuit of REST
41mOff the Tracks - Challenging the Rails Mindset
46mRails as a piece of birthday cake
37mBuilt to last: A domain-driven approach to beautiful systems
40mBlow Up Your Views
27mDecouple Your Models with Form Objects
