GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — java-design-patterns/memento/README.md at master · coding0011/java-design-patterns

Expand file tree

/

README.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
34 lines (25 loc) · 920 Bytes
/

README.md

Copy path

File metadata and controls

34 lines (25 loc) · 920 Bytes
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions
layout pattern
title Memento
folder memento
permalink /patterns/memento/
categories Behavioral
tags
Java
Gang Of Four
Difficulty-Intermediate

Also known as

Token

Intent

Without violating encapsulation, capture and externalize an object's internal state so that the object can be restored to this state later.

alt text

Applicability

Use the Memento pattern when

  • a snapshot of an object's state must be saved so that it can be restored to that state later, and
  • a direct interface to obtaining the state would expose implementation details and break the object's encapsulation

Real world examples

  • java.util.Date

Credits

  • Design Patterns: Elements of Reusable Object-Oriented Software
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.