Main Program

As discussed in Chapter 6, in order to develop reusable modules that can be linked together into programs and not just cobbled together in scripts, we put the main processing logic in a routine called from a shell main program.

Logic for the Shell Main Routine for CSV to XML
Arguments:
  Input CSV File Name
  Output Directory Name
  File Description Document Name

Options:
  Validate output
  Help

Validate and process command line arguments
IF help option specified
  Display help message
  Exit
ENDIF
Create new CSVSourceConverter object, passing:
    Validation option
    Output Directory Name
    File Description Document Name
Call CSVSourceConverter processFile method, passing
    the Input File Name
Display completion message

On first glance this type of structure may seem like a bit of overkill. It would be if we were going to process only a single input file. However, it facilitates future enhancements such as accepting a directory as input and converting all the files in the directory.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset