/
Memento Design Pattern Memento Design Pattern

Memento Design Pattern - PowerPoint Presentation

ellena-manuel
ellena-manuel . @ellena-manuel
Follow
448 views
Uploaded On 2016-11-18

Memento Design Pattern - PPT Presentation

Lee Lisle Overview Why would we use Memento Examples of Memento How to implement Memento Why Memento Undo Checkpointing Saving a programs state Examples Rectangles See Design Patterns book ID: 490399

design memento caretaker patterns memento design patterns caretaker originator object computer science org wikibooks examples doesn

Share:

Link:

Embed:

Download Presentation from below link

Download Presentation The PPT/PDF document "Memento Design Pattern" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

Slide1

Memento Design Pattern

Lee LisleSlide2

Overview

Why would we use Memento?

Examples of Memento

How to implement MementoSlide3

Why Memento?

Undo

Checkpointing

Saving a program’s stateSlide4

Examples

Rectangles

See Design Patterns book,

Memento section

Not a direct example

Re-use of a method doesn’t guarantee the same

resultSlide5

Mementos in GamesSlide6

How to use Memento

Three “actors” in a Memento

The Memento Object

The originator

The caretaker

Ideally the Memento is not stored by the Originator

Enables “saving”

The Caretaker keeps the object but doesn’t read it

Wide versus Narrow Interfaces (friend descriptor in C++)Slide7

Java Example – Wikibook

Computer Science Design Patterns

https://

en.wikibooks.org/wiki/Computer_Science_Design_Patterns/MementoSlide8

Memento Design Pattern

Why?

Memory

What?

Timing for solvers

Games

How?

Caretaker

, Originator,

Memento

Works Cited

Gamma, Erich.

Design Patterns: Elements of Reusable Object Oriented Software.

Addison-Wesley Professional. 1995.

Memento.

https://en.wikibooks.org/wiki/Computer_Science_Design_Patterns/

Memento

. January 2014. October 2015.