In this final part of the Command Pattern series, we will talk about yet another improvement on top of the Command Processor Pattern. It is described in the paper Command Revisited. From now on, we will just refer to it as the Command Revisited Pattern.
The paper is short and sweet but you might not find it to be to the point after the first glimpse.
The most beautiful part of the Command Revisited Pattern is that it provides a new perspective on the general Command Pattern.
In Part I, we discussed the original Command Pattern from the GoF Design Patterns book. In Part II, let’s talk about the improved version from another less known book: Pattern-Oriented Software Architecture Vol.1 (POSA in short).
In this book, there is a Command Processor pattern, which is based on the Command Pattern in GoF book. The most important difference is the newly introduced CommandProcessor.
In the original Command Pattern, it defines how to create Commands, and each Command has an execute and undo methods.
The Command Pattern is one of my favourite design patterns. It is also a good example that design patterns do change over time. In part I, we talk about the original version from the Design Patterns book.
This pattern first appears in the famous GoF book, described as follows: Encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations.
I was tasked to create a simple media player app for a shop demo, and I’m using the built-in SeekBar for the volume control. All goes well, until I want to change the color of it. The design has it like the thumb of the SeekBar is white, and first half is green and rest half is grey. It took me almost a whole day to find a satisfying anwser, come on Android!
I have been collecting various keyboard over the years. Now I’m quite proud of my small collection, so I think I will share it here.
The One And Only True Keyboard Yes, this is the famous IBM Model M. Typing on it is like playing piano, the sound and feel is so crisp.
The IBM Model M2 I got this from a Finnish second hand website, it is much like a modern keyboard, except that the switches are still the same as original Model M.