
There Is No Such Thing As a Service
If you have been following this series, you know I am a fan of services. Dependency injection, single responsibility, clean boundaries between concerns. Done right, you end up with hundreds of services, each doing exactly one thing. But here is the problem nobody talks about: the word "service" does not actually mean anything. ItemService . What does it do? Everything. What is inside? Who knows. You have to open it and start reading. And the more your codebase grows, the more that class becomes a dumping ground, a god class disguised by a reasonable name. I want to argue that the service as we know it is just one of many distinct types of classes we could be writing. And the moment you start thinking in terms of those types, your code becomes something anyone can navigate on instinct alone. The Problem With "Service" When a codebase is healthy, your services are focused. Something like: /Users UserService AuthenticationService AuthorizationService TokenService /Items ItemService ItemRe
Continue reading on Dev.to
Opens in a new tab



_.png&w=1200&q=75)