Use Cases identifies some scenarios where an user is using the system:
- User wants to delete all stock records from the database
- User wants to scan all available files and add the data to the database
- User wants to scan all files within a specified time range
- User wants to update the database with the latest results from StockReader
The program will have three different modules:
- User Interface - Collects the parameters and call methods/functions
- FileScanner - Select which csv files to scan and determine whether the data in a row contains enough information so that it can be added to the database.
- DBParser - Build SQL queries and launch them. Database error handling.
Now, I have a rough idea what the program should look like. I have added a couple of user interface widgets to my app. The code is stubbed right now:
I will clean up this form later. |
In the "Directory to Scan" group box, the user will be able to select where the input files are. The text of the button shows the current folder.
The user will be able to clear the database and scan all files that matches the dates in the folder. The algorithm will look like this:
- List all csv files in the current folder.
- For all files that are matching the time interval:
- Check the headers in order to know how to interpret the data.
- For all rows in the file:
- If the needed data is there for that stock, add the information to the database
I have also created two classes: FileScanner and DBParser. Those are instantiated when the program starts.
In the next blog post, I'll fill the classes and widgets with code.
No comments:
Post a Comment