Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Memento Design Pattern

Video Lecture

Section Video Links
Memento Pattern Memento Memento Pattern
Memento Use Case Memento Use Case Memento Use Case

Book

Cover Links
Design Patterns In TypeScript (ASIN : B0948BCH24)    https://www.amazon.com/dp/B0948BCH24
   https://www.amazon.co.uk/dp/B0948BCH24
   https://www.amazon.in/dp/B094716FD6
   https://www.amazon.de/dp/B0948BCH24
   https://www.amazon.fr/dp/B0948BCH24
   https://www.amazon.es/dp/B0948BCH24
   https://www.amazon.it/dp/B0948BCH24
   https://www.amazon.co.jp/dp/B0948BCH24
   https://www.amazon.ca/dp/B0948BCH24
   https://www.amazon.com.au/dp/B0948BCH24

Overview

... Refer to Book or Design Patterns in TypeScript website to read textual content.

Terminology

... Refer to Book or Design Patterns in TypeScript website to read textual content.

Memento UML Diagram

Memento UML Diagram

Output

node ./dist/memento/memento-concept.js
Originator: Set state to 'State #1'
Originator: Set state to 'State #2'
CareTaker: Getting a copy of Originators current state
Originator: Providing Memento of state to caretaker.
Originator: Set state to 'State #3'
CareTaker: Getting a copy of Originators current state
Originator: Providing Memento of state to caretaker.
Originator: Set state to 'State #4'
State #4
CareTaker: Restoring Originators state from Memento
Originator: State after restoring from Memento: 'State #2'
State #2
CareTaker: Restoring Originators state from Memento
Originator: State after restoring from Memento: 'State #3'
State #3

Memento Use Case

... Refer to Book or Design Patterns in TypeScript website to read textual content.

Example UML Diagram

Memento Use Case UML Diagram

Output

node ./dist/memento/client.js
Score: 200, Level: 0, Location: {"x":0,"y":0,"z":2}
Inventory: ["sword","rifle"]
CareTaker: Game Save
Score: 500, Level: 1, Location: {"x":0,"y":0,"z":13}
Inventory: ["sword","rifle","motorbike"]
CareTaker: Game Save
Score: 600, Level: 2, Location: {"x":0,"y":0,"z":14}
Inventory: ["sword","rifle","motorbike"]
CareTaker: Restoring Characters attributes from Memento
Score: 200, Level: 0, Location: {"x":0,"y":0,"z":2}
Inventory: ["sword","rifle"]

Summary

... Refer to Book or Design Patterns in TypeScript website to read textual content.