← Graph

Domain as Function from Commands to Events

concept 1 connections

Krzywda's formulation of a domain in the talk: a domain is a function whose input is a set of granular commands (e.g. SetPrice, SetPercentageDiscount, RemoveDiscount, ActivateTimePromotion) and whose output is a very similar set of events. Handling a command either succeeds and publishes events or raises an exception. Typically implemented with aggregates, but any code shape that maps command to events works. Keeping domains as pure functions avoids coupling between them and makes them reusable; coordination happens outside via processes.

category
pattern
about
Domain as Function from Commands to Events concept
Defines each domain as a function from commands to events.

Provenance

Read by
8 extractions