Join Jungwoo Ryoo for an in-depth discussion in this video Memento, part of Python: Advanced Design Patterns.
- [Instructor] It is often necessary…to revert an action when using a system.…For example all of us are familiar with ubiquitous…undo shortcuts in our word processing programs.…In the case of database applications,…rollback is an essential option…because irreversible changes…can do humongous damage to both your tasks at hand,…and future objectives.…If you're looking for a design solution,…to this type of programming need,…memento is a perfect behavioral design pattern for you.…
This pattern allows you to capture…the internal state of an object at a certain point in time,…and to restore that same state…later in the future if necessary.…An object can take on this task…in addition to its core mission,…but this will make it bulkier and more complex.…A better solution is to introduce a new object…dedicated to storing the history…of transactions associated with the other object.…
Note that the goal here is not to store…every single property of a target object,…but to get only those relevant to your undo operation.…The memento pattern uses three classes…
- Architectural vs. design patterns
- Why use design patterns?
- Design best practices
- Domain-specific patterns and security patterns
- Gang of Four design patterns
- Command, Mediator, and State
- Template method
Skill Level Advanced
Learning Python and Django (2015)with Caleb Smith1h 11m Intermediate
Programming Foundations: Design Patternswith Elisabeth Robson2h 19m Intermediate
1. Understanding Design Patterns: Review
2. Design Best Practices
3. Gang of Four (GoF) Patterns, Part 1
4. Gang of Four (GoF) Patterns, Part 2
Next steps1m 26s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.