Designing scripts for composition
Many large applications are amalgamations of multiple smaller applications. In enterprise terminology, they are often called application systems comprising individual command-line application programs.
Some large, complex applications include a number of commands. For example, the Git
application has numerous individual commands, such as git pull
, git commit
, and git push
. These can also be seen as separate applications that are part of the overall Git
system of applications.
An application might start as a collection of separate Python script files. At some point during its evolution, it can become necessary to refactor the scripts to combine features and create new, composite scripts from older disjoint scripts. The other path is also possible: a large application might be decomposed and refactored into a new organization of smaller components.
In this recipe, we'll look at ways to design a script so that future combinations and...