Monday, October 24, 2011

Java: Hotline Update #14

It's been quite a while since I've updated this blog. During this time quite a few changes have occurred with the Hotline program, mostly cosmetic. Names of representatives have been added or removed, options have been added or removed and I've update the reporting tool a bit. This last part is the most important of all the changes that have occurred as of late.

Previously the reporting tool was a large If-Else statement with an array being populated with call/email option values depending on what date range was in the If part of the statement. This was messy, and each time new options were added a new If-Else piece had to be added and some corresponding changes to other parts of the code made to manage this update. No longer. I've updated and condensed the code into a single array that contains all of the values ever assigned for email/phone options.

issueNumber = 50;

issueNames = new String[issueNumber];
issueNames[0] = B1;
issueNames[1] = B2;
issueNames[2] = B24;
issueNames[3] = B31;
issueNames[4] = B3;
issueNames[5] = B4;

And so on and so forth. Now the order of issues saved is always the same and the same array is used regardless of the date range searched under. What I do instead is any value that is zero is simply excluded from the report, so only those values that contain real information are visible and I'm not reporting on values that aren't in use for the date range selected. This also helps to reduce the lines of code in each portion of the project and makes updating for the future a far easier concept.

Next project for this application is to include some additional reporting tools that will allow the CS managers greater flexibility.

No comments: