IBM i General Design Standards › Design Standards for Commands › Why Use Commands?
Why Use Commands?
Most user application systems will be menu driven. However, you should consider providing commands to invoke the main programs in a system, for example those programs that are called as menu options. There are several reasons for this:
- Using commands can simplify and standardize design, and also reduce the amount of HLL programming required. The command definition language should be regarded as a specialized HLL in its own right that is specially suited to both validating input data and translating external values into internal values.
- Commands have a great capacity for enhancement and modification. Additional parameters can be added to commands without affecting the existing usage of the command either by programs or menus.
- An expert user often finds it more efficient to use commands because it requires fewer transactions with the computer to achieve a desired result. This is especially important in a remote environment, where it might be tedious to have to follow a many-level menu tree to reach a particular menu option, and also for the experienced user.
- Commands are a good ‘hook’ on which to hang system documentation. In terms of the system architecture, each command is the entry point to a function, and all the salient points about the use of that function may be summarized at the command level. Help panel groups can be used to provide full help.
- The CL command syntax notation is available as a concise and rigorous notation for documenting commands. Apart from brevity, the command syntax notation has the following advantages:
- It is unambiguous.
- It is complete. It shows all permitted values for parameters.
- It provides visible defaulting. The actual options used are always explicitly stated.
- Commands are a "consistent user interface", with which most users of iSeries will already be familiar.
- Commands have an intuitive "verb-object syntax" that is easy to learn. It is interesting to observe that two thirds of the 400 or more OS/400 commands are constructed using a common vocabulary of just ten verbs. As a result, a user need remember very little to be able to invoke a wide range of functions.
- Commands allow for both "fast" and "slow" user paths:
- A positional facility, and the provision of default values, gives expert users an efficient interface.
- Sophisticated prompting and syntax checking functions support the novice user—commands are error tolerant, and usually give meaningful diagnostics.
- Help text, prompt overrides, Prompt control, and dynamic choice text can provide further guidance.
- Commands, being the entry points to using the particular functions, are convenient objects on which to implement security, for example to grant or revoke object authorities.
- Commands can be used to set the product library, for example to find the appropriate National languages version.
Note: The standards that should be applied to the design of commands are described below.