This is an old version of this course, from Winter 2013-2014. A newer version is avaliable here.
Instructions
See the lab on emerald. If you plan to work from home, use your browser's "save as" to cache a copy or ensure you have your VPN (e.g. GlobalConnect) configured correctly.
Demonstrations
About 1 hour into the lab, please demonstrate what you have accomplished from the list below. For this lab, the steps below are best performed in order, as each step builds on the one before. You only need to include the code for the final step in your zip, but discuss all the steps in your report.
- Comment out the "TODO" lines and associated code. You will come back to them later. In ClientUI.actionPerformed(), call EventLogger.getInstance and eventLogger.logEvent instead of creating a thread to run logSomeEvents.
- Write a logger that does not use the singleton pattern. See the section "Without Singleton" in the report submission section below. For this step, write to a hard-coded log file (ignoring or not taking the path to the log file, so you don't have to handle that yet.)
- Implement the Singleton pattern. See the "Without Singleton" section again.
- Extend your singleton to include multiple instances, one for each log file. See section "Hashing" in report outline.
- Include all of the TODO's in the code. Run tests with these. See section "Stress testing."
Submission (due Week 6, Tuesday, in class)
Submit your report in hard-copy. Follow this format:
- (5 pt.) Title & Introduction: Include the lab number & name, your name, the course name, the quarter (e.g. Winter 2013), and the date. Very briefly describe the lab.
- (25 pt.) Without Singleton: Describe the behavior of the program if multiple instances are created. What happens, and why? Include brief snippets of logs produced with and without the Singleton pattern and explain the difference. (You do not need to include the without singleton code in your source zip, only the final version.)
- (25 pt.) Hashing: Describe how you extended the generic singleton pattern to track multiple instances. Include code-snippets as helpful. Give particular attention to how you handle synchronization (if non-trivial).
- (25 pt.) Stress-testing: Describe any bugs you discovered during the stress tests or why you are confident that your code passed the test. In this stage, include the "TODOs" that you commented-out at the beginning. There are some in each of the provided classes.
- (10 pt.) Conclusions: Summarize what you learned in the lab.
- (10 pt.) Source (emailed, not printed)
- (100 pt. Total)
E-mail me your source code in a zip file, due Week 6, Tuesday, at 11pm. The .zip file is a backup if I'm not able to understand something in your report. The grade for the source will be:
Condition | Score |
source uneeded | 10/10 |
source needed, present | 7/10 |
source needed, not present | 0/10 |