P
Peter Mueller
Hello,
I have a basic question about the command pattern.
Let's assume there is a command AddItemCommand and another one
RemoveItemCommand.
The implementation of execute() in the AddItemCommand is basically the
impl. of undo() in the RemoveItem command and vice versa. If this is
the case. How can code duplication be avoided using the command
pattern?
Probably I missed something general with with command pattern.
Thanks for your help.
Peter
I have a basic question about the command pattern.
Let's assume there is a command AddItemCommand and another one
RemoveItemCommand.
The implementation of execute() in the AddItemCommand is basically the
impl. of undo() in the RemoveItem command and vice versa. If this is
the case. How can code duplication be avoided using the command
pattern?
Probably I missed something general with with command pattern.
Thanks for your help.
Peter