1 00:00:00,570 --> 00:00:06,840 The common pattern is use whenever you want to encapsulate inside an object all the data required for 2 00:00:06,840 --> 00:00:08,390 performing, they given action. 3 00:00:09,480 --> 00:00:15,930 This pattern is also known as a consumer producer pattern, mainly because it allows us to decouple 4 00:00:15,930 --> 00:00:19,380 objects that produce the commands from their consumers. 5 00:00:20,610 --> 00:00:22,790 Let's have a look at this UML diagram. 6 00:00:23,400 --> 00:00:29,100 On one hand, we have the command interface, which specifies the contract for the concrete commands. 7 00:00:30,000 --> 00:00:33,840 The concrete commands use the composition to store the receiver object. 8 00:00:35,090 --> 00:00:40,640 On the other hand, we have the invoker, which is the object that knows how to execute the commands. 9 00:00:41,710 --> 00:00:48,640 The Invoker refers to the command interface to perform a request which makes the Invoker independent 10 00:00:48,790 --> 00:00:50,800 of how the request is performed. 11 00:00:51,860 --> 00:00:54,830 Let's see how we can implement this pattern into Cote.