
Software Design – The Command Pattern
We continue our look into the behavioral patterns with an examination of the Command pattern. This is another one of them that will seem very familiar. In fact, you have probably made use of this in one way or another in your code. The Command Pattern Defined As always, we will start with the “Gang of Four” intent to set the stage for our discussion. “Encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations.” This intent is short and sweet both in the description and in implementation. The goal is to create an object that can be passed around as a function. When we do this, we are allowed... Read more