From chaos to elegance refactoring complex workflows with events
summary
Refactors a messy Roland Garros ticket payment flow (PSP, 3DS, backoffice) into a synchronous event-driven choreography that breaks monolithic use cases into small commanders and listeners. Implements a hand-rolled command bus and event bus with decorator middleware, keeps workflows observable via logging and sequence diagrams, and handles concrete failures (backoffice rejections and failed bank cancellations that trigger a support email). The refactor reduced end-to-end tests from many to three.
AI-written summary · about
chapters (11)
- 0:00Event-driven intro
- 4:41Orchestration vs choreography
- 6:24Observer pattern
- 13:47Commands in events
- 17:39Payment demo
- 20:50Test duplication issues
- 21:11Refactor to choreography
- 32:37Choreography pros and cons
- 38:13Readable choreographies
- 39:36Prerequisites and best practices
- 41:00Conclusion
related talks
43mEvent driven development
41mCommand and (e)mission Control
58mFrom Zero to Live with Functional JavaScript Applications (Part 2)
19mIs Beauty Only Skin Deep?
58mModernizing an existing system to take a more domain-driven approach
46mShifting Gears: From Events to Event-Driven
40mDecoupling your Springboot microservices live coded using workflow automation
34mOperate Heavily Dynamic UIs with RxJS
