phases New pair of shoes ordered Old pair of shoes worn out Order new pair of shoes New pair of shoes delivered Order Fulfillment History Customer-driven Supplier-driven Supplier-exploring Human to Machine Supporting Service Customer-determined Machine to Machine Automated Service @martinschimak
shoes New pair of shoes delivered Domain Command Domain Event “Long-running” service Order fulfillment service Supplier-driven Customer-determined Machine to Machine Automated Service @martinschimak
New pair of shoes delivered Order fulfillment service “Long-running” service “Long-running” asynchronous contract Hours to weeks @martinschimak Domain Command Domain Event
Goods shipped ... can lead to a hidden form of accidental coupling Payment Service Inventory Service Goods fetched Payment retrieved ... to change implicit process logic ... Change listener 1 ... Change listener 2 ... Change listener 3 ... @martinschimak
Choreo- graphy Orches- tration Process logic Process control explicit central implicit decentral Service coupling high low Not necessarily Not necessarily @martinschimak
not fire the command? And listen to an event? Order Service Fetch goods Retrieve payment Ship goods Payment retrieved Goods fetched Goods shipped Order fulfilled Fire Fire Fire Listen Listen Listen
Request and Response Style Sender/Receiver Exchange Probably Transient Asynchronous by Nature Fire and Forget Style Publish/Subscribe Exchange Probably Persistent Command Event Or Asynchronous! Like Fire and Listen? @martinschimak
Synchronous Request and Response Style Sender/Receiver Exchange Probably Transient Asynchronous by Nature Fire and Forget Style Publish/Subscribe Exchange Potentially Persistent Command Event Or Asynchronous! Like Fire and Listen? Like Publish and Promise to Subscribe? @martinschimak
specified an intent This just models our “state of mind” We use imperative tense to express intent Defined by supplier bounded context, created by customer system We created an outcome This models everybody’s “state of world” We use past tense to express an outcome Defined and created by emitter bounded context and system Command Event @martinschimak
context Retrieve payment Payment retrieved Financial Services Bounded Context „When YOU send this WE promise to receive and act!“ „When WE send this YOU decide to receive and act!“ Command Event @martinschimak Make the contract explicit!
specify intent New pair of shoes ordered Retrieve payment Domain Events Customer Supplier Order placed Order Service @martinschimak Domain Command Domain Event
but not all New pair of shoes ordered Promote customer Domain Events Payment retrieved Promotions service Customer promoted Promotions service @martinschimak Domain Command Domain Event
Process logic Process control explicit central implicit decentral Service coupling high low Not necessarily Not necessarily Not necessarily Not necessarily @martinschimak
and Response Style Sender/Receiver Exchange Probably Transient Asynchronous by Nature Fire and Forget Style Publish/Subscribe Exchange Probably Persistent Command Event Or Asynchronous! Like Fire and Listen? Like Publish and Promise to Subscribe? @martinschimak
requested Charge credit card Depending on account balance Withdraw amount from account Amount Withdrawn Credit card charged Credit card failed Update credit card details Account details Credit card details updated Whenever card details are updated After two weeks Depending on the amount Amount credited Mark payment retrieved Mark payment canceled Payment failed Credit amount to account Whenever payment is canceled Mark payment received Payment retrieved
Charge amount by credit card I want that kind of reactive business process execution Charge amount by credit card Credit amount back to account Update credit card details Check customer account balance Payment requested Depending on account balance Charge credit card Withdraw amount from account Credit card charged Whenever credit card is charged Mark payment received Payment received Amount Withdrawn Depending on the amount Mark payment received Payment received Mark paym. partly covered Payment partly covered Whenever payment p. covered Charge credit card Credit card failed Whenever credit card failed Update credit card details Credit card details updated Whenever card details are updated Charge credit card After two weeks Mark payment canceled Payment canceled Whenever payment is canceled Credit amount to account Amount credited Every two days Remind customer Customer reminded Withdraw amount from cust. account