Design Patterns · Junior · Question 17 of 75

What is the Command pattern used for?

Explanation

A command contains everything needed to perform an action and, if necessary, to undo it (execute/undo). This is how undo/redo in editors, operation queues and macros are implemented. Redux actions are a related idea: an action is described by an object.

Further reading

Problem with a question

Design Patterns · Junior · question 17

Test yourself

Take the Design Patterns · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz