Doug Tucker's Public Blog

Jan 13

Interesting post! Looking forward for the next time you update it!

A Project I Designed and Implemented

During my internship at TVA, I was asked to build a project using Visual C# that would interface with Oracle databases, SQL databases, and .csv files. There were 2 copies of the databases, the “old” ones being in an Oracle database or .csv file, and the “new” one being an SQL database, and this project is needed to sync the new database with the older databases before the older databases are phased out. This was challenging for me because I was new to Oracle and SQL queries, and also Visual Studio and C#.

To tackle this challenge, I first designed the GUI, which consisted of checkboxes corresponding to the tables to be updated, a “Select/Deselect All” button, an “Update” button, a progress bar, and a “status” label. After that, I incrementally developed and implemented each part. First, I added each table one-by-one and tested each to make sure the program was handling it and that the table columns were matching on the back-end. Then I added logging functionality and the progress bar code. Each table is executed in a separate thread so that the GUI doesn’t freeze. Also, a timer was added to show that the program is executing and not frozen. That was version 1.0.

After this, I added some functionality for aesthetics and usability. This includes fading out the buttons and checkbox lists as the queries execute. I also added the functionality to execute the queries in parallel or sequentially. The end user can also choose whether they want to log in to the “Production” server (which is the “live” version) or “Development”, where I and my supervisor can test my program. This is version 1.1, the current version.

My main focus on this project was 1) ease-of-usability, 2) effectiveness, and 3) the ability for expansion. To achieve these, I paid attention to detail both visually and in the code.

For ease-of-usability, I only allowed checkboxes and displayed a read-only text box listing the .csv files, not allowing the user to accidentally type the wrong file. The select/deselect all button is nice and automatically opens two file dialogs for the two .csv options.

For effectiveness, I went through measures to create detailed logs of each execution of the program. If any error occurs (either locally or on the server), it is reported through a pop-up window and the log file records the error message so I can fix it. I also implemented the parallel execution in addition to the original sequential execution for speed’s sake - sequentially, all 8 tables take about 10 minutes to update; in parallel, it takes about 1 minute 15 seconds.

For the ability for expansion, I implemented the aforementioned superclass to encapsulate both the Oracle queries and .csv files. While coding, I wrote a template for how to add a new Oracle query object or a new .csv file object, then hard-coded the objects currently in use next to the template so that it is easy to add. I can personally attest to this because I have added new tables and it took ~10 minutes total, including testing.