© Vaskaran Sarcar 2020
V. SarcarDesign Patterns in C#https://doi.org/10.1007/978-1-4842-6062-3_17

17. Command Pattern

Vaskaran Sarcar1 
(1)
Garia, Kolkata, West Bengal, India
 

This chapter covers the Command pattern.

GoF Definition

Encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue, or log requests, and support undoable operations.

Concept

Using this pattern, you encapsulate a method invocation process. Here an object can invoke an operation through some crystalized method and doesn’t worry about how to perform the operation. This pattern is among those patterns that are normally tough to understand by merely reading the description. The concept becomes clearer when you see the implementations. So, ...

Get Design Patterns in C#: A Hands-on Guide with Real-world Examples now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.