phases New pair of shoes ordered Old pair of shoes worn out Order new pair of shoes New pair of shoes delivered Job Execution 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 Command Event “Long-running” service Order fulfillment service Supplier-driven Customer-determined Machine to Machine Automated Service @martinschimak
New pair of shoes delivered Command Event Order fulfillment service “Long-running” service “Long-running” asynchronous contract Hours to weeks @martinschimak
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
We specified an intended job 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 a relevant change This models everybody’s “state of world” We use past tense to express change Defined and created by emitter bounded context and system Command Event @martinschimak
context Retrieve payment Payment retrieved Financial Services Bounded Context „When YOU publish this WE promise to subscribe and act!“ „When WE publish this YOU decide to subscribe and act!“ Command Event @martinschimak Make the contract explicit!
but not all New pair of shoes ordered Promote customer Command Event(s) Events Payment retrieved Promotions service Customer promoted Promotions service @martinschimak
Process logic Process control explicit central implicit decentral Service coupling high low Not necessarily Not necessarily Not necessarily Not necessarily @martinschimak
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? Like Publish and Promise to Subscribe? @martinschimak
withdrawn Withdraw amount Payment partly covered Credit Card charged Charge credit card Payment retrieved Order placed Retrieve payment Order fulfilled Order items “Fact”sourced sagas know the flow of events and commands created by itself. @martinschimak