Skip to content

Latest commit

 

History

History
17 lines (9 loc) · 547 Bytes

memento-pattern.md

File metadata and controls

17 lines (9 loc) · 547 Bytes

Memento Design Pattern

Memento pattern captures the internal state of an object without exposing its internal structure so that the object can be restored to this state later.

Solution

  1. Implementation based on nested classes

Memento Structure 1

  1. Implementation based on an intermediate interface

Memento Structure 1

  1. Implementation with even stricter encapsulation

Memento Structure 1