Code with Jason cover image

167 - "Vanilla Rails is Plenty" with Jorge Manrubia of 37signals

Code with Jason

00:00

The Problem With Service Objects

Service object is an overloaded term that means different things to different people. If you're working in a realistic code base, you're going to find yourself with that object-oriented language. The smell that indicates that you might need a method object is that you have like a series of methods sharing the same params over and over. That's like a smell. And you can refactor that by extracting a new class, a new class that contains all those methods that receive the commonparams in the constructor. Then you invoke that method as an operation. To me, that's kind of a better approach than presenting a series of archetypes with a lot of overlapping between them.

Transcript
Play full episode

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app