by ismaelct · 2y ago · 0 comments
Pipeline steps are command objects (a pretty standard OO pattern), so they have a single entry point / public method. But they can still fully leverage any other OO pattern in their implementation. The more complex ones I use may instantiate other objects, pass messages between them, etc.
But the single-method #call API is what makes composition easy. See Rack, or any number of middleware-style designs, for other common uses of this in Ruby.
I feel like that's the kind of over-simplification that then makes people pick a style like this without fully considering the implications.
Every single place that I've seen use these "command pattern" systems devolved into a complete utter mess of procedures. People forget the basics of OO and write everything into "steps" because that's now the hammer and everything is a nail.
If they stuck to the outer layers as the orchestrator for everything, that'd be great. But that never happens in my experience.
I think you're right about how that line comes across, I'll try and improve it.