Well, I am developing an application for a productive plant. There are six modules used in the production, each module at different machine types. These modules used to collect data about the production, mainly filled by the machine operators, but some data are coming from external ERP system. There are other modules used to evaluate the collected data and make reports, queries, etc. The application covers the whole production process of the factory. For each module, there are custom classes which responsible for one or more function of the given module. For example a custom class is responsible to open a module for a machine.
Till now, only one module was able to be opened in one time, because the instances of custom classes were defined in a separate module. According to a new demand, one module should be opened in more than one instance in one time on the same machine and with the current logic it is not possible. To rewrite the whole application would be a huge work and now I am seeking for alternative solution.
My idea is to use a global collection in which I store all custom class instances and I refer to the instance by its index in the collection. As a part of this solution I want to use the mentioned function to create new object and add to the collection. To do this, I planned to give the class name to the function as a string parameter and in basis of it add a new object to the collection. With a quite long select-case it is no problem, I just want to shorten and make simpler the code.
Hope it is now clearer what is my intention and what I want with the function.
VoiD