All, I spent some time searching around for a similar question but wasn't successful, perhaps I need to work on my search queries.
I am wondering what people's thoughts are on the following topic:
Let's say I have a framework which needs to be designed and coded in Matlab. The framework consists of a "tasking engine" which needs to keep track of various tasks, assign them to other objects to be executed, and collect the results. Each task is similar, but different. The tasks, for example, could be things like Walk, Run, Transport, etc.
One approach to this is to have an abstract class Task, and have Walk, Run, and Transport all inherit from it. I can keep track of all the tasks in a Heterogeneous array. This approach seems more inline with typical OOP style, and seems to be a more organized approach off the bat.
Another approach would be to have a single (non-abstract) class Task, which keeps track of these various tasks in a large array. This class would have to implement logic to determine which tasks are of which type, and execute them accordingly. This approach seems less like traditional OOP style, and more akin to what Matlab was originally designed for.
I'm wondering, do people have a preference for one versus the other? Do you think I can expect a performance difference with one versus the other?
Are there questions I'm missing/forgetting to ask?
For reference, I am using Matlab 2017a.
Thank you in advance,
Chris