I'm writing a GUI application which needs the facility for users to interact with the system and execute tasks via a sort of command line interface.
The user will type commands in a text box, with the following format:
[Command-name] [Param-name] [Value]
Where any number of Param-names and Values can be written after the Command-name.
An example of use:
New_Customer NAME John AGE 34
The above command would call the appropriate method where, say, a new customer is added to the database.
Another example:
PLAY FILM Harry_Potter VOLUME 50 FPS 24
The obvious and relatively straightforward way to implement this is to parse the user input, using SPACE as a delimiter, and then use a sequence of ifs and elses to process the command.
For basic commands like the ones above, this approach is probably good enough, but as the syntax and semantics of the commands become more complex, I worry that all those ifs and elses will become unwieldy and hard to manage.
Is there a design pattern or common method I may find useful?