Many complex suites of applications follow a design pattern similar to the one used by the Git program. There's a base command, git
, with a number of subcommands. For example, git pull
, git commit
, and git push
.
What's central to this design is the idea of a collection of individual commands. Each of the various features of git can be thought of as a separate class definition that performs a given function.
When we enter a command such as git pull
, it's as if the program, git
, is locating a class to implement the command.
How can we create families of closely related commands?
We'll imagine an application built from three commands. This is based on the applications shown in the Designing scripts for composition, Using logging for control and audit output, and Combining two applications into one recipes. We'll have three applications—simulate, summarize, and a combined application called simsum.
These features are based...