Combining many applications using the Command Design Pattern
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 under a common parent command. Each of the various features of Git
can be thought of as a separate class definition that performs a given function.
In this recipe, we'll see how we can create families of closely related commands.
Getting ready
We'll imagine an application built from three commands. This is based on the applications shown in the Designing scripts for composition and Using logging for control and audit output recipes in Chapter 13, Application Integration: Configuration, as well as the Combining two applications into one recipe from earlier in this chapter. We'll have three applications...