c# - Command Pattern - Purpose? -
after reading this: http://sourcemaking.com/design_patterns/command
i still don't quite understand why need this.
the idea if commands encapsulated objects commands can captured, stored, queued, replayed etc.
it makes easier command know how undo (ie perform reverse operation) if command processed can stored in list , 'undone' in reverse order restore state before commands done.
also decouples sender of command receiver. can allow multiple things generate same command (a menu item , button example) , handled in same way.
Comments
Post a Comment