Podcast
Questions and Answers
The Originator class has methods to create a memento but not to restore its state from a memento.
The Originator class has methods to create a memento but not to restore its state from a memento.
False (B)
The Memento class stores the internal state of the Caretaker.
The Memento class stores the internal state of the Caretaker.
False (B)
The Caretaker class is responsible for creating new mementos.
The Caretaker class is responsible for creating new mementos.
False (B)
The Main class is responsible for setting the initial state of the Originator object.
The Main class is responsible for setting the initial state of the Originator object.
The Iterator Pattern is not used in the example described.
The Iterator Pattern is not used in the example described.
The Memento Pattern does not involve exposing the internal state of the Originator.
The Memento Pattern does not involve exposing the internal state of the Originator.
The Caretaker class provides methods to change the state of the Originator object.
The Caretaker class provides methods to change the state of the Originator object.
The Memento Pattern does not involve designing interfaces and access control to mitigate potential violations of encapsulation.
The Memento Pattern does not involve designing interfaces and access control to mitigate potential violations of encapsulation.
The Main class in Example 5 restores the state of the Originator by creating a new memento.
The Main class in Example 5 restores the state of the Originator by creating a new memento.
The Memento Pattern example provided explicitly demonstrates violations of encapsulation.
The Memento Pattern example provided explicitly demonstrates violations of encapsulation.