Policy mode vs command mode

Source: Internet
Author: User

Before reading this article, you must have a certain understanding of the policy mode and command mode.

Policy mode: it is mainly used to encapsulate algorithms. The advantage of encapsulation is that the algorithm is replaced at will.

Command mode: the requester does not need to care about a specific command, how the command is executed, and how the execution process is. For example, give me a dish. It is just a command, and then the waiter (accept the request) calls the Kitchen Master's cooking (performer ). Throughout the execution process, the requester does not need to care about it. It only needs to provide a command, and someone will naturally help with this command.

The following uses a class diagram to analyze the policy 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.