/// 1. Easy to design command queues
/// 2. If necessary, you can easily log commands
/// 3. easily undo and redo commands
///
/// Command mode:
/// Split the object requesting an operation from the object that knows how to perform an operation.
/// Note: Generally, a method is called directly through an object or a class,
/// There is a tightly coupled relationship between the behavior requestor and the behavior implementer, that is, the call relationship between A and B)
/// For example, when you need to record the call implementation, undo, and redo operations of the series of actions,
/// Decoupling between these behavior requestor and behavior implementers is required.
/// The command mode gives you an idea: abstract, introduce a third party, and implement decoupling.
/// This is also a common decoupling concept for many design models.
///
Namespace Commandpattern
{
Class Program
{
Static Void Main ( String [] ARGs)
{
Document Doc = New Document ();
Command docmd = New Docommand (DOC );
Command undocmd = New Undocommand (DOC );
Command redocmd = New Redocommand (DOC );
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.