Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 19. Memento > Persisting Mementos Across Sessions

Persisting Mementos Across Sessions

A session occurs when a user runs a program, conducts transactions in the program, and exits. Suppose that your users want to be able to save a simulation in one session and restore it in another session. This ability is a matter normally referred to as persistent storage. Persistent storage fulfills the intent of the MEMENTO pattern and is a natural extension to the undo functionality you have already implemented.

Suppose that you subclass the Visualization class with a Visualization2 class that has a menu bar with a File menu with Save As... and Restore From... items:


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint