I'm trying to create a load of "commands" - basically a string defining the command name, and about 4 functions related to it. Normally, I'd bundle each "command" into a static class and just have lots of different static classes for each command.
However, I also want to be able to have a list of all the commands available, so I have the ability to call the functions by knowing the command name - this can't be done with static classes.
I thought about using reflection to build a list. I also thought about using a singleton pattern and in each constructor, add the single object to a static list shared by all "command" classes. Neither of these methods is particularly neat though...
Is there a design pattern for this scenario? Or any methods people have used in the past? All advice appreciated!
I'm using C#, although it's not really that relevant to the question.