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:

  1. Bank: TransferMoney(accountA, accountB, amount).
  2. Shopping: CalculateDiscount(customer, products).
  3. Shipping: CalculateShippingCost(order, destination).

Think: “What business operation needs to happen?”


Back-End My-Journey-In-Codeless