Model Mitosis: dealing with model tensions
summary
Demonstrates Model Mitosis: iteratively dispatch behaviors into provisional bounded contexts, duplicate-and-specialize overlapping concepts, then shrink a shared kernel until clear boundaries emerge. Uses IntelliJ, in-memory repositories and a chatbot assistant (Shot 3PO / chatripio) to refactor a monolith search+booking codebase into separate search and booking models with an anti-corruption layer mediating conversions. Builds a working booking feature, fixes compilation and invariant issues, and justifies eventual service split when search load and deployment cadence diverge.
AI-written summary · about
chapters (17)
- 0:00Introduction
- 1:37The MVP success and problems
- 2:50Demonstrating the new feature
- 4:17Code review and model tension
- 6:35Decoupling search and booking
- 8:19Analyzing model duplication
- 12:25Refactoring by behavior
- 15:42Dispatching domain concepts
- 18:29Handling shared concepts
- 21:15Implementing a shared kernel
- 25:54Anti-corruption layer
- 30:27Implementing new features
- 33:47Refining model specialization
- 37:11Tax computation logic
- 41:24Handling past bookings
- 44:55Finalizing service isolation
- 49:41Theoretical debrief and conclusion
