File tree Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 10
10
* [ Strategy] ( behavioral/strategy ) [ :notebook : ] ( https://en.wikipedia.org/wiki/Strategy_pattern )
11
11
* [ Command] ( behavioral/command ) [ :notebook : ] ( https://en.wikipedia.org/wiki/Command_pattern )
12
12
* [ Template] ( behavioral/template ) [ :notebook : ] ( https://en.wikipedia.org/wiki/Template_pattern )
13
+ * [ Memento] ( behavioral/memento ) [ :notebook : ] ( https://en.wikipedia.org/wiki/Memento_pattern )
13
14
14
15
## [ Creational] ( creational )
15
16
Original file line number Diff line number Diff line change @@ -8,3 +8,4 @@ We are going to deal with behaviors instead of define structures or encapsulate
8
8
* [ Chain of Responsibility] ( chain ) [ :notebook : ] ( https://en.wikipedia.org/wiki/Chain-of-responsibility_pattern )
9
9
* [ Command] ( command ) [ :notebook : ] ( https://en.wikipedia.org/wiki/Command_pattern )
10
10
* [ Template] ( template ) [ :notebook : ] ( https://en.wikipedia.org/wiki/Template_pattern )
11
+ * [ Memento] ( memento ) [ :notebook : ] ( https://en.wikipedia.org/wiki/Memento_pattern )
Original file line number Diff line number Diff line change
1
+ # Behavioral » Memento
2
+
3
+ ## Description
4
+
5
+ The memento pattern provides the ability to restore an object to its previous
6
+ state (undo via rollback). It is implemented with three elements:
7
+
8
+ - originator
9
+ - caretaker
10
+ - memento
11
+
12
+ The originator is an object that has an internal state. The caretaker change
13
+ the originator's state, but wants to be able to undo the change. The caretaker
14
+ first asks the originator for a memento object. Then it does whatever operation
15
+ it was going to do. To roll back it returns the memento object to the
16
+ originator.
17
+
18
+
19
+ ## Implementation
20
+
You can’t perform that action at this time.
0 commit comments