Skip to Content
Visual Basic Design Patterns: VB 6.0 and VB.NET
book

Visual Basic Design Patterns: VB 6.0 and VB.NET

by James W. Cooper
November 2001
Intermediate to advanced
512 pages
9h 10m
English
Addison-Wesley Professional
Content preview from Visual Basic Design Patterns: VB 6.0 and VB.NET

Chapter 27. The Memento Pattern

In this chapter, we discuss how to use the Memento pattern to save data about an object so you can restore it later. For example, you might like to save the color, size, pattern, or shape of objects in a drafting or painting program. Ideally, it should be possible to save and restore this state without making each object take care of this task and without violating encapsulation. This is the purpose of the Memento pattern.

Motivation

Objects normally shouldn't expose much of their internal state using public methods, but you would still like to be able to save the entire state of an object because you might need to restore it later. In some cases, you could obtain enough information from the public interfaces (such ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming Visual Basic 2008

Programming Visual Basic 2008

Tim Patrick
Visual Basic 2015 Unleashed

Visual Basic 2015 Unleashed

Alessandro Del Sole

Publisher Resources

ISBN: 0201702657Purchase book