How to Effectively Isolate Layers?
summary
Shows how to refactor a typical Symfony application into a hexagonal, DDD and CQRS architecture by reorganizing code into four folders (infrastructure, application, domain, ui), removing controller annotations and replacing fat controllers with thin single-action controllers, and moving business logic into domain models and validators. Demonstrates using Symfony Messenger to dispatch commands and queries, implementing interface-based repositories and a ParamConverter for custom requests, fixing a flush-related memory leak, and delivering a modular monolith with tests and a public repository.
AI-written summary · about
chapters (10)
- 0:00Layer isolation intro
- 6:29Code problem diagnosis
- 8:18Hexagonal architecture in practice
- 10:46Removing framework dependencies
- 15:51Domain layer as app core
- 20:30App layer responsibilities
- 23:42Commands and Command pattern
- 27:16Data validation and custom requests
- 30:11Error handling and events
- 31:59Summary and next steps
related talks
34mDon't Let the Framework Stand in Your Way
42mDecoupling Domain Code from Framework and Infrastructure
25mCode decoupling from Symfony (and others frameworks)
40mDDD, CQRS, Hexagonal, Onion,... Putting it together
47mThe End of Layered Architectures with the Hexagonal Approach
45mThe End of Layered Architectures with the Hexagonal Approach
02h 10mLet's play a game: No extends. Advanced OOP with Symfony 3
43mControllers: Beyond HTTP and Symfony
