Skip to content

An example of how to implement and use the Command Pattern

Notifications You must be signed in to change notification settings

MortenFilt/CommandPattern

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 

Repository files navigation

CommandPattern

An example of how to use the Command Pattern

Within this project, you can find a simple implementation of the GoF Command Pattern. It supports simple commands, with an example using a light, Macro Commands to execute multiple commands at a single call and Undo of the last Command.

To add more functionality to the solution, simply add your class with implementation into ItemTypes and create the command classes you want in Commands.

The container method used for Macro Commands can be changed to other containers. The Undo can be changed to a stack-like container to enable a chain of undos.

I hope this example can be of use in understanding how the pattern works.

About

An example of how to implement and use the Command Pattern

Topics

Resources

Stars

Watchers

Forks

Languages