Design: Undo functionality using Command Pattern
Design the command pattern structure to support undo functionality in a local application. Out of scope: redo functionality, distributed undo, or persistent undo history.
Functional Requirements
FR1: Support executing commands that change system state
FR2: Allow undoing the last executed command
FR3: Support multiple undo operations in sequence
FR4: Commands should be encapsulated as objects
FR5: Maintain a history of executed commands for undo
FR6: Ensure commands can be extended easily for new operations
Non-Functional Requirements
NFR1: Undo operations must be efficient with minimal latency
NFR2: Support up to 1000 commands in undo history
NFR3: System should be modular and easy to maintain
NFR4: Memory usage should be optimized for command history
