In this chapter you will learn about the Command design pattern, how to implement undo and macro operations, and write very simple Unix command variations, which can be cancelled after execution.
Imagine that you are writing the printer program and want to implement the printer spooler. What is the the easiest way to do it? Create a
Spooler class with methods to add and remove printer jobs. The easiest way to execute printer jobs is to create an object, which contains all necessary information: text to print, number of copies, color, quality, and so on. The spooler will need to call the
execute method of the print job, and the print job will take care of everything by itself.
That's how the ...