Behavioral patterns
Memento
Capture an object's internal state into an opaque snapshot you can stash away and restore later, implementing undo without breaking encapsulation. An animated lesson where the diagram draws itself as the design grows.
- Lesson 9 of 10
- Animated diagrams
Sign in with Google or GitHub and you land straight on this page. DSA comes with the all labs plan and every ChaiCode batch.
Behavioral patterns
What you will learn
- The idea: a snapshot you can put back
- An analogy: save points in a game
- The three roles
- Why encapsulation survives
- Versus Command-based undo
- The cost of snapshots
More low-level design
Watch Memento take shape
Sign in and the lesson opens with its diagram ready to play, and the rest of Behavioral patterns beside it.
DSA comes with the all labs plan and every ChaiCode batch.