Practical design patterns in PHP (Part 3)
summary
Builds a working PHP event‑sourcing prototype: aggregates (invoice, shopping cart) record recorded domain events as mementos, events serialize to JSON and sit in either a file-system and in-memory stores (tests pass). Implements repository + simple event bus, replays event streams to reconstitute aggregate state, and refactors persistence into a storage strategy via Composer utilities (class-function). Notes it takes about half a day to prototype, warns it’s experimental and not yet production‑ready.
AI-written summary · about
chapters (11)
- 0:00Introduction to behavioral patterns
- 1:20Memento pattern explained
- 22:31Event sourcing with Memento
- 1:00:16Implementing event store
- 1:30:49State pattern for workflows
- 1:45:20Strategy pattern fundamentals
- 2:05:26Refactoring with Strategy
- 2:15:18Template method design
- 2:30:30Visitor pattern in PHP
- 2:45:58When to use Visitor pattern
- 2:50:07Summary and Q&A
related talks
43mAdding Event Sourcing to an existing PHP project (for the right reasons)
50mFrom Events to Insights: Testing and Documenting Event‑Based Software
41mAdding Event Sourcing to an existing PHP project (for the right reasons)
21mSoftware Design Patterns in Laravel 4
58mPHP + ES + CQRS + DDD = ? An integrated strategy
29mprooph/micro and FPP - less is more
58mObjects, Testing and Responsibility
36mAn Introduction to OOP, Design Patterns, and TDD
