paint-brush
Refactoring Ruby Code: From Service Objects to Object Designby@aleksandrov
173 reads

Refactoring Ruby Code: From Service Objects to Object Design

by Igor Alexandrov8mDecember 14th, 2023
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Service objects were discussed many times by several authors. Usually, they are a code smell, and I will not try to explain why again. I will show a practical example of refactoring a service object into an object-orientated code. I will not try to blame anybody; probably, it was me who clicked the “Approve” button on the PR that introduced the code listed below. Anyway, I believe it is always better to return and work on your mistakes.

Company Mentioned

Mention Thumbnail
featured image - Refactoring Ruby Code: From Service Objects to Object Design
Igor Alexandrov HackerNoon profile picture
Igor Alexandrov

Igor Alexandrov

@aleksandrov

Ruby/Crystal developer, JetRockets and OneTribe CTO and co-founder

L O A D I N G
. . . comments & more!

About Author

Igor Alexandrov HackerNoon profile picture
Igor Alexandrov@aleksandrov
Ruby/Crystal developer, JetRockets and OneTribe CTO and co-founder

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite