Using Delphi 2010, I am needing to write a program to support modules, or plug-ins. Although a little contrived, assume I have an app which converts datafiles/text files. It will support 30 input formats and those same 30 formats as outputs. The first release will probably only implement a few of these formats. My challenge is that I want a data driven process flow.
For example, assume I have a PARSE_FILE routine. If my input data file format is 'Format_A', then then when I call PARSE_FILE, it should know to use PARSE_FILE_Format_A, as opposed to the other 29 different versions of the PARSE_FILE routine.
PARSE_FILE is just an an example. I will probably have 60 different common functions, LOAD_FILE, GET_DELIMITER, PARSE_FILE, etc, but each of these functions will be a little different for each of the 30 different formats. What technique can I use so that if I am Loading a file with FORMAT_A, each one of these 60 different common routines uses the proper 'version' of these 60 routines?
Keep in mind that I am starting with just 5 input formats, and will add other formats later, so I need a way of centrally defining this "mapping', so wherever these routines are used throughout my code, the proper version of the routine will be used even though I call the generic version.