I'm making a simple test object-oriented program to try and help me get to grips with OOP. I've got an ICommand inteface which has the method Run(params object[] parameters) and I have various classes that use that interface and implement their own versions of run. Each class also has a name property which says what the command is and what it does.
I want to have a GUI where I can create commands, which presumably will need some sort of listbox to select what type of command to create. The question is, how do I make that listbox and make it work without hardcoding in a switch statement with explicit references to all of the classes I've created.
I'm sure this is a really simple problem that I should know the answer to, but I just can't think of it! I'm sure there is an answer though.
Oh and I expect some of the responses will say to read the Design Patterns book: well the only copy in the library is out at the moment, but I will be reading it asap!
Update: I've just posted a follow up question here