Two OO ways to design something, curious what everyone's thoughts are? This is w/out context of a framework, just purely OO perspective.

Option 1 - Stateless object w/ Rich Result

Option 2 - Stateful object (e.g. command pattern + internal state to store results)

https://gist.github.com/davetron5000/19aa850df641be6c334e9b64a944b6c8

My thoughts follow, but I am not sure which is the "best" pattern - again all things being equal/not in Rails/etc.

stateful.rb

GitHub Gist: instantly share code, notes, and snippets.

Gist

@davetron5000 stateless is nice and clean but inevitably requirements evolve and it no longer need to do “just one thing” or doing the one thing involves a series of internal methods and having internal state would clean up their parameters.

I think “best” probably changes over time (usually evolving from stateless to stateful)

@jamie So you prefer to use instance variables to pass data between private methods (vs using method arguments)?
@davetron5000 @jamie Don't answer, Jamie! It's a trap!
@emma @jamie lol, I would have a follow up question but am honestly looking for experience, not to shame anyone Not Doing It My Way™
@davetron5000 very often, there are 1-2 objects that most internal methods need. It bugs the shit out of me to pass them around.
@jamie This makes sense to me, at least for objects that are dependent e.g. a service that the class calls. I would not do this for stuff the class operates on or for cases of functional decomposition to private methods - those would take args for what would've been local variables (hard to explain in a toot)