December 2021
Intermediate to advanced
352 pages
10h
English
The Chain of Responsibility pattern forwards requests along a chain of classes, but the Command pattern forwards a request only to a specific object. It encloses a request for a specific action inside an object and gives it a known public interface. It lets you give the client the ability to make requests without knowing anything about the actual action that will be performed. It also allows you to change that action without affecting the client program in any way.
We have, of course, seen this command interface already, as we have been using in our DButton class, which includes a comd method that is called when you click the button.
When you build a Python user interface, you provide menu ...
Read now
Unlock full access