From the course: JavaScript: Patterns
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Memento pattern - JavaScript Tutorial
From the course: JavaScript: Patterns
Memento pattern
- [Instructor] The memento pattern is basically providing temporary state of an object and restoration of that object from a conversion into a different format or whatnot. It is often used into serialization and deserialization of data. In this use case, an object is typically in a JavaScript object, where we need to transmit the data to some type of back-end, where we serialize this object into JSON for streaming it through HTTP protocols. Then, when this object hits the back-end server, or when we get a response back from the server through HTTP, we might need to deserialize the JSON object back into a JavaScript object for consumption into our application. Well, this is basically the memento pattern in action, where the data never loses its accuracy, despite several conversions in between formats.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
What are behavioral patterns?1m 4s
-
(Locked)
Observer pattern2m 36s
-
(Locked)
State pattern3m 6s
-
(Locked)
Chain of responsibility1m 30s
-
(Locked)
Iterator pattern3m 44s
-
(Locked)
Strategy pattern1m 36s
-
(Locked)
Memento pattern53s
-
(Locked)
Mediator pattern1m 32s
-
(Locked)
Command pattern2m 24s
-
(Locked)
-