I'm looking for some advice on how much I should be concerned around avoiding the anemic domain model. We are just starting on DDD and are struggling with analysis paralysis regarding simple design decisions. The latest point we are sticking on is where certain business logic belongs, for example we have an Order
object, which has properties like Status
etc. Now say I have to perform a command like UndoLastStatus
because someone made a mistake with an order, this is not as simple as just changing the Status
as other information has to be logged and properties changed. Now in the real world this is a pure administration task. So the way I see it I have two options I can think of:
Option 1: Add the method to order so something like
Order.UndoLastStatus()
, whilst this kinda make sense, it doesn't really reflect the domain. AlsoOrder
is the primary object in the system and if everything involving the order is placed in the order class things could get out of hand.Option 2: Create a
Shop
object, and with that have different services which represent differant roles. So I might haveShop.AdminService
,Shop.DispatchService
, andShop.InventoryService
. So in this case I would haveShop.AdminService.UndoLastStatus(Order)
.
Now the second option we have something which reflects the domain much more, and would allow developers to talk to business experts about similar roles that actually exists. But its also heading toward an anemic model. Which would be the better way to go in general?