Generic services and granular abstractions
Services appear to be powerful the first time you use them. Not sure where to put code for yet another use case? Just create a file under app/services
. As simple as that. We can even notice a tendency: developers discuss where to put certain code in the application’s file hierarchy.
This thinking-in-folders ideology is fundamentally broken. First, it usually implies that in any unclear situation, just create a service. Secondly, although a file structure positively affects developer experience and should be treated with respect, the place of the code in the application must be driven by its role, and the role is defined by the abstraction layer the code belongs to. Developers should think in abstractions, not folders when designing new features or refactoring legacy code.
Anemic models
Overusing service objects could lead to a situation when models do not carry any business logic (beyond object-relational mapping (ORM) or data...