Skip to content

Commit 7ce8bfd

Browse files
committed
updates
1 parent f03a88c commit 7ce8bfd

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

memento/README.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Memento Design Pattern
22

3+
## Videos
4+
5+
Section | Video Links
6+
-|-
7+
Memento Overview | <a id="udemyVideoLink" href="https://www.udemy.com/course/design-patterns-in-python/learn/lecture/25632774/?referralCode=7493DBBBF97FF2B0D24D" target="_blank" title="Memento Overview"><img src="/img/udemy_btn_sm.gif" alt="Memento Overview"/></a>&nbsp;<a id="ytVideoLink" href="https://youtu.be/gQnKnmSu8xA" target="_blank" title="Memento Overview"><img src="/img/yt_btn_sm.gif" alt="Memento Overview"/></a>&nbsp;<a id="skillShareVideoLink" href="https://skl.sh/34SM2Xg" target="_blank" title="Memento Overview"><img src="/img/skillshare_btn_sm.gif" alt="Memento Overview"/></a>
8+
Memento Use Case | <a id="udemyVideoLink" href="https://www.udemy.com/course/design-patterns-in-python/learn/lecture/25632770/?referralCode=7493DBBBF97FF2B0D24D" target="_blank" title="Memento Use Case"><img src="/img/udemy_btn_sm.gif" alt="Memento Use Case"/></a>&nbsp;<a id="ytVideoLink" href="https://youtu.be/DFEvyjiUA_A" target="_blank" title="Memento Use Case"><img src="/img/yt_btn_sm.gif" alt="Memento Use Case"/></a>&nbsp;<a id="skillShareVideoLink" href="https://skl.sh/34SM2Xg" target="_blank" title="Memento Use Case"><img src="/img/skillshare_btn_sm.gif" alt="Memento Use Case"/></a>
9+
Getters/Setters | <a id="udemyVideoLink" href="https://www.udemy.com/course/design-patterns-in-python/learn/lecture/25632784/?referralCode=7493DBBBF97FF2B0D24D" target="_blank" title="Getters/Setters"><img src="/img/udemy_btn_sm.gif" alt="Getters/Setters"/></a>&nbsp;<a id="ytVideoLink" href="https://youtu.be/6ijrepx6jgM" target="_blank" title="Getters/Setters"><img src="/img/yt_btn_sm.gif" alt="Getters/Setters"/></a>&nbsp;<a id="skillShareVideoLink" href="https://skl.sh/34SM2Xg" target="_blank" title="Getters/Setters"><img src="/img/skillshare_btn_sm.gif" alt="Getters/Setters"/></a>
10+
311
## Book
412

513
Cover | Links
@@ -160,15 +168,3 @@ print(example.value)
160168
del example.value
161169
print(example.value) # now raises an AttributeError
162170
```
163-
164-
## Summary
165-
166-
* You don't need to create a new Memento each time an Originators state changes. You can do it only when considered necessary. E.g., an occasional backup to a file.
167-
168-
* Mementos can be stored in memory or saved/cached externally. The Caretaker will abstract the complications of storing and retrieving Mementos from the Originator.
169-
170-
* Consider the [Command](/command) pattern for fine grained changes to an objects state to manage UNDO/REDO between memento saves. Or even save command history into a Memento that can be later replayed.
171-
172-
* In my examples, the whole state is recorded and changed with the Memento. You can use the Memento to record and change partial states instead if required.
173-
174-
* When copying state, be aware of shallow/deep copying. In complicated projects, your restore functionality will probably contain a combination of both the [Command](/command) and Memento patterns.

0 commit comments

Comments
 (0)