How to avoid entity services

Ürgo Ringo
Wise Engineering
Published in
1 min readJan 27, 2020

--

Ceiling of a hall at PROTO invention factory

Entity services are services that are modelled around data instead of behavior. It’s an antipattern when implementing “Service” classes in a single monolith. Entity services are even worse in microservices architecture where they inevitably lead to distributed monolith.

One way how to avoid such entity services is intentional naming. Naming is very powerful way how we can direct our thinking and create positive constraints for software designs. If we want to build services that are formed around behavior and not data then we should also name them using verbs or processes instead of nouns.

Name services using verbs instead of nouns

There is no “user domain” and there should also be no “User Service”. Instead we can have “User Registration Service” or “User Authentication Service”. By naming our service by the primary business action or process we also make it clear what is the behavior we want it to implement. This way we avoid situations where it is very clear what data our service cares about but not clear at all what is the behavior besides basic CRUD.

--

--

Ürgo Ringo
Wise Engineering

Have been creating software for 20 years. Cofounded a software consultancy, worked as an IC and team lead at Wise. Currently working at Inbank.