Definition: A domain service contains business logic that belongs to the business/domain but does not naturally belong to one specific entity or object.
It represents an operation or business rule involving one or more domain objects.
Examples:
- Bank:
TransferMoney(accountA, accountB, amount). - Shopping:
CalculateDiscount(customer, products). - Shipping:
CalculateShippingCost(order, destination).
Think: “What business operation needs to happen?”