Ivan Nemytchenko

Talk: The Curse of Service Objects

Serial CTO of small-to-medium size startups

The Curse of Service Objects

Service Objects were a mistake. It has nothing to do with OOP. It has little to do with ideas of Fowler, Evans and Martin. I analyzed a plenty of open repositories, videos and articles, and in this talk I will show all the flaws of this “pattern”, and how it contributes to complexity management.

Service Objects is most widely accepted practice in the Ruby community. Yet, I insist, it is very controversial “pattern”, and in some cases hurtful. In most cases it opposes the idea of Single Responsibility Proinciple, kills the idea of Layered Architecture and makes our code non-modular.

In my talk I will analyze the idea of Service Objects from four different perspec- tives: 1. Idea of OOP 2. Practice (analysis of articles & videos about Service Objects) 3. Philosophy (how it matches the ideas of Evans, Fowler and Martin) 4. Its effect on complexity distribution in dynamics (based on code of GitLab and Discourse)

My goal is to shake your beliefs by exposing issues of the “pattern”, show where we took a wrong turn, and show how ideas of Service Layer (Fowler) and Do- main Services (Evans) can be implemented in Rails without all the problems of commonly used pattern.


Serial CTO of small-to-medium size startups