Business/Domain logic in domain models and service objects -


i trying design domain layer both rich models(anemic models bad oo practices). learned ddd not exclude service objects, , domain layer design healthy balance of domain logic split both domain models , service objects. wonder though, if business logic should divided between domain models , service objects, should line drawn? in other words, how know if business logic belongs domain model or service object? there rule of thumb specifies behavior should go domain models while others belong service objects? please let me know if can give little bit of hint, thanks.

since domain services part of domain model, assume mean domain services vs. domain objects.

toran billups has give similar answer here, jimmy bogard nice blog-post here.

as general rule of thumb: domain services stateless, while domain objects have state. thus, depends on internal state go domain object, concepts not depend on current state and/or not conceptually fit single domain object modeled domain services.


Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -