Skip to content
Preptima
mediumConceptDesignMidSeniorStaff

How do you decide whether a piece of behaviour belongs on the domain object or in a service?

6 min readUpdated 2026-08-15Target archetype: Big Tech, Enterprise Captive, Product Startup

Answer

Short answer

Behaviour that needs only the object's own state, and any rule the object must never violate, belongs on the object. Services own orchestration across objects, anything requiring I/O, and the transaction boundary - which is why an entity should never hold a repository.

Was this answer helpful?

Likely follow-ups

  • The rule needs data from a second aggregate. What are your options, and what does each one cost you?
  • Your ORM demands a no-argument constructor and field access. How do you keep the invariant intact?
  • When is a class named FooManager evidence of a missing concept, and when is it genuinely fine?
  • Two services compute the same eligibility rule slightly differently. How did that happen, and where does the rule go now?

Related questions