What is Domain Services? How to use it?

Carlos Bueno
3 min readJul 30, 2020

Last week, we nailed the root cause of the problems, the root of our problems making your model so big and difficult to understand — we need to avoid these mistakes in order to make the code testable, easy to comprehend, and extendable. Today, we’ll look at how we can use other pieces of stuff from DDD to become your code better, or, in other words, do painless DDD.

What is Domain Services?

Service-Oriented Architecture (SOA), application services, and domain services, none of these concepts have similarities, but it causes a lot of confusion among most developers, as we can see in Blogs and discussions over the internet.

Is important to be aware of some characteristics of the domain services for model better your code.

You need to understand the three fundamental characteristics of Domain Services: they reflect behavior, so they don’t have an identity, they are stateless as well; and you can frequently use to orchestrate multiple entities and domain objects.

You frequently hear that domain services carry domain knowledge that you can’t put on Entities or Value Objects, So until now Domain Services is quite similar to Application…

--

--

Carlos Bueno

Carlos Bueno: RPG enthusiast, Big Bang Theory fan, functional programming devotee, and software engineer at Proximus Luxembourg. #CodeAndRoll