Shrek, Onions and Architecture
summary
Claim is that a messy PHP monolith really maps to an onion and becomes manageable by applying hexagonal architecture and DDD primitives like value objects and explicit entity lifecycles. Concrete tactics include designing ports and adapters, depending on abstractions only, using dependency injection, tagging deprecated methods and running static analysis with dep track. Testing guidance is practical not theoretical: avoid mocking the system under test, use anonymous classes for test implementations, and incrementally replace infrastructure adapters.
AI-written summary · about
chapters (9)
- 0:00Monoliths and legacy code
- 3:17Onion as architecture metaphor
- 11:25Monoliths grow like onions
- 21:10Mashed monoliths palatable
- 22:12Code clarity with ubiquitous language
- 27:53Keeping code lean
- 34:12Balancing dependencies
- 39:50Testing performance
- 42:42Recap and homework








