Design Mode-proxy Model)

Source: Internet
Author: User

Basic proxy mode Execution Process

1. initialize proxy)

1.1 initialize the real class)

1.1.1 set whether the flag is complete

1.2 construct the execution proxy class

1.2.1 register the "Create method" Event

1.2.2 load the "creation method of real classes" into the thread (generally, the demo is not used primarily)

1.2.3 start thread (generally not used. Demo-based)

2. Proxy registration events

3. proxy class Creation Method

3.1 determine whether the real class is loaded (it is impossible for the first time)

3.1 create a base class

4. Execute the creation method of the real class

4.1 set the completion mark

4.2 check whether the creation method is complete

5. Wait until the real class is created

6. Once completed, the real-class notification observer

7. Finally, the proxy class returns the result of the real class to the interface.

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.