1. commands encapsulate a request as an object so that you can parameterize the customer with different requests, queue requests or record request logs, and support unrecoverable operations. The command mode is related to life. Combined with the object-oriented thinking, there should be at least four classes: the command sender, the command receiver, and the command itself. Some may say that the command transmitter is redundant. Is it redundant? Why add a command transmitter? The command transmitter can be used not only to pass commands! First, extract an example from the Life: the hotel waiter is just a command transmitter in the mode. Imagine what would happen if there were no waiters in the hotel? The customer needs to place orders directly with the cook. No matter whether the food is ready or the food is not, the cook has to find a specific customer. What should I do if there are more customers? Do the chefs remember? I'm afraid he's too busy to cook his own food. Remember who ordered it! This is not complete yet. The customer wants to change the order and want to change the food. The chef is starting to grow. Which table is the food, which table is missing ...... What is the task of a hotel attendant? 1. Sort out customer orders-add, delete, and modify. Orders may need to be modified or deleted due to customer or hotel reasons. 2. Record the order 3. Send the sorted order to the cook. In this way, he only needs to cook the food according to the order given by the waiter. What changes are there in the process, and the waiter also manages the order. If there is no such dish, he only needs to pass it to the customer through the waiter and change it in time. It seems that in command mode, the passer is essential. The rest of the commands were issued by the sender and receiver, all performing their respective duties, and the system was running. Ii. Category chart