SOFTWARE DESIGN
DESIGN PATTERNS
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Mediator
|
|
Memento
|
|
State
|
|
Strategy
|
Detailed explanation-1: -Memento is a behavioral design pattern that lets you save and restore the previous state of an object without revealing the details of its implementation.
Detailed explanation-2: -The Memento Design Pattern offers a solution to implement undoable actions. We can do this by saving the state of an object at a given instant and restoring it if the actions performed since need to be undone. Practically, the object whose state needs to be saved is called an Originator.
Detailed explanation-3: -The Memento pattern is also known as Token. Undo or backspace or ctrl+z is one of the most used operation in an editor. Memento design pattern is used to implement the undo operation. This is done by saving the current state of the object as it changes state.