October 2018
Intermediate to advanced
370 pages
9h 15m
English
The command pattern is used to encapsulate required information in order to perform an action or start a process. The data is therefore put into an object that is passed to an executor. It's worth mentioning that execution of commands can also be delayed if this is necessary. The following diagram shows how this pattern can be implemented:

The preceding diagram contains the UserCommand interface, which is implemented by the CreateUserCommand and DeleteUserCommand classes. A constructor of UserCommand takes an instance of the User class and a certain implementation of the UserCommand interface, then encapsulates an operation with ...
Read now
Unlock full access