File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 22Command pattern decouples the object invoking a job from the one who knows
33how to do it. As mentioned in the GoF book, a good example is in menu items.
44You have a menu that has lots of items. Each item is responsible for doing a
5- special thing and you want your menu item just call the ` execute` method when
6- it is pressed. To achieve this you implement a command object with the ` execute`
5+ special thing and you want your menu item just call the execute method when
6+ it is pressed. To achieve this you implement a command object with the execute
77method for each menu item and pass to it.
88
99*About the example
1616Object oriented implementation of callback functions.
1717
1818*Examples in Python ecosystem:
19- Django HttpRequest (without ` execute` method):
19+ Django HttpRequest (without execute method):
2020https://docs.djangoproject.com/en/2.1/ref/request-response/#httprequest-objects
2121"""
2222
You can’t perform that action at this time.
0 commit comments