Command Pattern
A pattern that turns an action into an object so it can be queued or undone.
What is Command Pattern?
The Command pattern turns an action into an object, so it can be stored, queued, logged or undone. Text editors use it for undo and redo.
public interface ICommand { void Execute(); void Undo(); }
var history = new Stack<ICommand>();
var bold = new MakeBoldCommand(document, selection);
bold.Execute();
history.Push(bold);
Level: Master · More OOP terms at this level
Updated