Design Pattern (Part 06) — Memento Design Pattern

  1. Originator- It creates a memento containing a snapshot of its current internal state and uses the memento to restore its internal state. It’s one that initializes the memento with information that characterizes its current state. Moreover, it uses the memento to restore the internal state.
  2. Caretaker- This class is used for safekeeping memento’s snapshot of states.
  3. Memento- The memento object stores the internal state of the Originator.
Class Diagram
Scenario concept Diagram
Class Diagram For this Scenario

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Arun prashanth

Arun prashanth

Software Engineer at Virtusa (Pvt) Ltd.