Software Design – The Memento Pattern
We tackle the memento pattern in this episode. If you ever wanted to store the state of an object, then this is the one for you. You can think of this pattern as a way to take note of your instance and store it for later. The Memento Pattern Defined As always, we will start with the “Gang of Four” intent to set the stage for our discussion. “Without violating encapsulating, capture and externalize an object’s internal state so that the object can be restored to this state later.” The trick to this intent is to avoid violating encapsulation. The whole point of this pattern is to allow us to store and pass around the memento without having to keep track... Read more