Grokking Design Patterns for Engineers and Managers
0% completed
Memento Pattern
The Memento Pattern captures an object's state so it can be restored later, without exposing what is inside it.
You want a rollback. Before a risky deployment change, save the current configuration; if the rollout goes badly, put the old one back.
The obvious approach is to have something outside the config read all its fields and store them. Now the history manager knows about replica counts, image tags, and environment maps. Adding a field to the configuration means updating the history manager too. Every private detail has become public, and the encapsulation you had is gone.
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%