Why do we need services?

  • Plain Ruby methods solve most of the same problems as services most of the time. When a task can be done with just a method, that is almost always the preferable choice.

  • Services are not competitors or replacements for methods. They are an addition to them, another option in the same toolbox as primitives, methods, and classes.

  • For example, removing duplicates from an array can be done with an array, a hash, or a set, depending on the situation. The choice between a plain method and a service works the same way: use whichever brings an advantage in that specific case.

See also