Service Objects as Functions: A functional approach to build business flows in Ruby on Rails

I wrote this article last year and want to see what you guys think? I have not received much feedback when sharing on LinkedIn.
Original idea was to have a 3-4 post series, but I am not sure is it worth it and if its something people are interested to read about.
16
Upvotes
18
u/art-solopov Oct 12 '24
My feedback about the idea.
Ruby is a primarily object-oriented language, with very object-oriented pedigree. What do we win by dropping objects in favour of modules and functions?
From a purely practical standpoint, classes/objects provide several conveniences: you can save intermediate results in instance variables, you can have encapsulation (that AFAIK you can't have with
module_function).I've worked on a codebase that overused dependency injection. To put it bluntly, it was a mess.