Most developers treat account balances as the absolute source of truth, but this creates a redundant mess when building undo/redo systems. By shifting the ground truth to a transaction ledger, you can radically simplify your architecture and make state a disposable cache. See how renaming a few methods and adding an index pointer can make your Command Pattern implementation significantly more flexible.
Nov 19, 2021