This is my problem. So the question is, now that I have the name in text (read from a database) what is the best way to invoke it? The goal is to make it the easiest for the UI developer. I want to get it down to just one line of code to add to a form or inherit from a base class which handles all the menu items.
1. I could create a delegate that calls a generic function containing a big 'Select case' statement. This would solve the problem.
2. I could create a base class that handles the normal functions, like help, about, exit, etc. This class could then be inherited and the UI programmer would be responsible to Inherit this class and provide the additional code. This would solve the problem.
3. I could use reflection and look through an assembly and invoke the appropriate methods. This would solve the problem.
4. I could create a event collection to loop through and invoke the method by creating an event. I have seen this implemented in a C# implementation.
So any ideas? I'm open to suggestions.
Thanks,
Joey
|