The Observer Pattern
1 Purpose
The primary purpose of this assignment is to help you review (and
demonstrate that you have acquired) the knowledge and skills
required to use the observer pattern. There is no network
programming in this assignment.
2 Overview
You have already done some work for
KitchIntel, a (fictitious)
company that intends to simplify and improve all aspects of the
"kitchen experience" (including the purchase of food and materials,
meal preparation, and waste disposal).
Unfortunately, as is often the case when using Scrum
(because it is a lightweight process and not much time is devoted to design
at the start of the effort), the team has discovered a weakness
with the original design.
The team is now working on controllers for various hardware devices.
Your job is to work on the "dispensers" (i.e., the hardware devices
that will dispense items to users).
3 Preparatory Tasks
If you are not using a code management system (e.g., Subversion,
Git, Mercurial) then you should probably create a new project for
this assignment, and copy the refactored measurement package into it, since
you may need to go back to the original code at some point.
4 Documents
During the sprint planning meeting you took notes that, you think,
contain everything you need to proceed.
In case you lost them, they are
available here:
Notes from the Sprint 3 Planning Meeting
5 Tasks
You must write several new classes and interfaces.
In addition, you must write JUnit tests for the new classes.
When compiled (e.g., from the command line using javax -Xlint
),
your code must not generate any "raw type" warnings. In other words, your
solution must be type safe.
6 Submission
You must submit (using
Autolab) a
.zip
file
named pa3.zip
that contains:
- Your implementation of the required interfaces/classes
in the appropriate package(s).
- JUnit tests for all of your classes in a package
named
testing
.
You must include the Display
interface and
the CLIDisplay
class (and NOT the GUIDisplay
class) in the devicesimulator
package.
There is no limit on the number of submissions and no penalty for
excessive submissions.
7 Grading
Your submission will be graded as follows:
- Conformity to the Style Guide (Style) - 20% (All or Nothing)
- Passing your Tests (SelfTests) - 20% (All or Nothing)
- Coverage of your Tests (Coverage) - 60% (Partial Credit Possible)
Note that Autolab will not evaluate the correctness of your code. That is
the responsibility of your tests. Note also that, though Autolab will grade
as if it is possible to obtain 100% coverage, that may not be the case.
You are responsible for determining what is and isn't reasonable in that
regard.
Points will be deducted manually (i.e., outside of
Autolab) for code that is unclear, inelegant, and/or poorly
documented.