
Creating an empty interface "I" allows us to make explicit that objects of type "I" must be opaque. You can reference objects of type "I" and pass them around, but you can't invoke behavior.
Example: the Memento design pattern.

The intent of the Memento pattern is to support the creation of snapshops of the internal state of objects so that these objects can be restored to this state later.
That is, the Memento pattern helps us implement "undo" operations.
This is the structure of the pattern: 2/5
That is, the Memento pattern helps us implement "undo" operations.
This is the structure of the pattern: 2/5

A Memento is an object that stores a snapshot of the Originator's internal state.



The Memento is a private record of the internal state of the Originator. To preserve encapsulation, the Caretaker sees an opaque interface to the Memento. It cannot operate on or examine the contents of the Memento.
This is achieved thanks to the "Memento" empty interface.
5/5
This is achieved thanks to the "Memento" empty interface.
5/5