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 — Unity3DTraining/DesignPatterns/MementoPattern at master · UnitySample/Unity3DTraining

Expand file tree

/

MementoPattern

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

MementoPattern

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
MementoPattern
MementoPattern
 
 
MementoPattern.sln
MementoPattern.sln
 
 
README.md
README.md
 
 

README.md

Outline

备忘录模式

定义

在不破坏封装性的前提下,捕获一个对象的内部状态,并在该对象之外保存这个状态。这样以后就可以将该对象恢复到原先保存的状态。

小结  

备忘录模式适用于以下的情况:  

  • 当必须要保存一个对象在某一时刻的全部或者部分状态,以便在需要的时候可以将其恢复到先前的状态时;
  • 当使用接口让其他对象直接得到自己的状态会暴露对象的实现细节继而破坏对其的封装性时。
You are visitor 01402520 — 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.