Command Pattern
Medium — good to knowArchitecture
ELI5 — The Vibe Check
Every action in a text editor is a Command object: TypeTextCommand, DeleteWordCommand, BoldCommand. Because each action is an object, you can store them in a list, undo them (execute the reverse), redo them (re-execute), serialize them to disk, or queue them for later. This is exactly how Ctrl+Z works in every app you've ever used.
Real Talk
undefined
When You'll Hear This
undefined
Related Terms
Event Sourcing
Instead of storing 'balance: $100', event sourcing stores 'deposited $200, withdrew $50, withdrew $50'.
advancedArchitecture
Observer Pattern
Think of a newsletter. You (the publisher/subject) publish content. Your subscribers (observers) automatically get notified when new content arrives.
intermediateArchitecture
Strategy Pattern
You're writing a sorter and want to sort by price, name, or date depending on user choice.
intermediateArchitecture