Wednesday, June 27, 2007

Java: Hotline Update

Apparently I get to now experience what programmers worldwide already know, those in charge of a program's content like to add all sorts of features without regard for how this will affect the coding of the program itself. I had confirmed that the call options were static and would not change, but apparently that is not the case.

Five additional call options needed to be added to Hotline along with removing a representative's name and adding an additional reporting option. Obviously, removing the rep's name was by far the easiest of all the changes needed, this just required altering a few variables and removing a few lines of code. This did not change any functionality of the program, unlike the other changes that needed to be made.

Adding the five new buttons, each one representing a call type, was not much more involved. New variables needed to be added and then listeners associated with those JButton variables defined. Once this was set it was only a matter of arranging the new buttons to make logical sense, and then resetting the grid layout to incorporate those new buttons. Unfortunately I was unable to convince the others to leave the number of possible buttons at a decent numbers, such as fifteen or sixteen, so instead they settled on seventeen. This makes the program look a little chunky due to the wasted space at the bottom, but it is only a visual issue and not a functionality problem.

The problem with adding new call options after the program went live to the call center is that now the files for June are formatted one way, and the files for July another. Running a report for one month has to be done differently than the report for the other as a result. Due to the changes a few variables must change value for each report type. Instead of rewriting the reporting call and having a separate call for each month I decided to use an If-Else statement to set the values of those variables. If the month being reported is June then the variables are set to deal with a twelve call option file, otherwise they are set to deal with a seventeen call option file.

Finally a new report was required that would acquire the total values for two types of calls, labeled as technical calls, and display those values in the JTextArea. This was needed by the tech group for month end reporting purposes. Thankfully the location of these buttons didn't change from the twelve to seventeen option frame so the same call would obtain the necessary information from each file due to it being in the exact same location.

With these changes the program itself is ready to be re-released to the call center starting in July. Hopefully no major changes will be needed for August, but at least the groundwork is laid to make these changes much easier to accomplish.

No comments: