January 2025
Intermediate to advanced
304 pages
8h 28m
English
The Command pattern is a behavioral design pattern that allows us to turn method calls into objects. By doing that, we open up a world of possibilities, such as serializing method calls to pass them through the network, delaying method calls, serializing method calls to save game states, queuing method calls to create turn-based combat systems, and more.
The Command pattern is widely used in applications as the go-to approach to implementing features such as undo/redo systems since they allow the application to create a stack of commands, with each containing the values used to make the method call. Since commands have all the information involved in a method call, they can be used to undo the operation, ...
Read now
Unlock full access