2015-03-09---prototype mode

Source: Internet
Author: User

This morning to the training, the afternoon study, Bo mainly said to everyone is tomorrow and the day after again to continue training, so these two days bring less things, such as today, only prototype mode one. In short, more recent things, I want to slowly adjust them all well.

Let's say a prototype model today, first on the UML diagram:


Generally, the best way to clone is to initialize the information without changing the situation. This hides the details of object creation, and there is a great improvement in sex.

Be sure to consider the problem of deep and shallow copies.


In fact, this pattern before I always use, just do not know the original this thing has such a name, today is a glimpse, today this let me see the previous understanding of a deep copy and shallow copy of the problem. Deep and shallow copies are actually in memory, pointers or references pointing to the same piece of memory.

Prototype mode, that is, it is convenient to clone with us, there is a clone method for us to invoke.

Today to go to bed early, tomorrow or 6 o'clock to get up ah, come on, tomorrow afternoon rest to get more technical things, ready to 15th before you must finish the C + +, and then see the course for the first from the heavy to start cocos2d-x, good, so yy a moment to go, you also early to sleep.



2015-03-09---prototype mode

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.