How to use the command design pattern in C#

patterns are proven solutions used to solve common design and reduce the complexities in code. The Gang of Four design patterns fall into three categories:

  • Creational  patterns related to object creation
  • Structural  patterns related to object assembly
  • Behavioral  patterns related to object collaboration and separation of responsibilities

The command design falls under the behavioral pattern category. This article explores how we can work with the command design pattern in C#.

What is the command design pattern?

The intent of the command design pattern is to decouple the requester of an action from the object that executes the action. In the command design pattern, a request is encapsulated as an object that contains all information about the request. This object is then passed to an invoker object. The invoker object then looks for the appropriate object to handle the command and passes the command to the object.

You might also like
Leave A Reply

Your email address will not be published.