IOS design model learning (23) Memorandum

Source: Internet
Author: User

1 Preface

We borrowed the idea of pasting similar objects to save the object state and restore it later. The status itself is created as an object (instant post ). It encapsulates the internal state of the original object. Only the original object that is created as an instant sticker can understand the Saved state and use it to restore the original state. A Design Pattern carefully designed from this idea is called the memorandum pattern.

2. Details

2.1 Brief Introduction

Capture the internal state of an object without damaging the encapsulation, and save the state outside the object. In this way, the object can be restored to the previously saved state.

2.2 When to use

(1) You need to save the state of an object (or a part) at a certain time point so that it can be restored to the previous state;

(2) The interface used to obtain the status exposes the implementation details and needs to be hidden.

3 conclusion

The above is all content and I hope it will help you.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.