Command Pattern Implementor

Implement the Command pattern to encapsulate requests as objects, enabling parameterized operations, queuing, logging, and undo/redo. Use when you need to decouple UI elements from operations, implement multi-level undo with command history, support macro recording, queue or schedule requests, or log operations for crash recovery. Includes the complete undo/redo algorithm using a command history list with present-line pointer, MacroCommand for composite operations, and SimpleCommand template for eliminating subclasses.

bookforge-ai Updated

File contents

bookforge-ai/bookforge-skills/tree/main/books/design-patterns-gof/skills/command-pattern-implementor commit 8dbae87cdc

Frequently asked questions

npx skillmds@latest add bookforge-ai/command-pattern-implementor