Command mode in Design Mode

Source: Internet
Author: User

To be continued, the update is expected to be completed at 10.28.

1 concept

The client sends one or more commands or requests without worrying about who the receiver is and how to implement it.

2. Applicable scenarios and advantages and disadvantages

Applicable scenarios: the client needs to send different commands at different times; the client and receiver need to be decoupled; the system needs to support the Undo redo operation.

Advantage: strong scalability, easy to combine commands.

3 Interpretation of command mode

Abstract commands

Specific commands: receive recipient commands

Receiver: Detailed Implementation

Caller: holding the command object

Client: create a specific command and set the receiver for the command.

4. Implementation example

 

Command mode in Design 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.