The basics.
-
Download the homework files from D2L, as explained
here.
-
Complete the files in the
src
directory
correctly.
-
Upload the homework files to D2L, as explained
here.
-
You can view the source code online
here [source].
Notes
-
Not that much has changed from hw-01.
-
There are three packages:
-
There are interfaces for Video,
Inventory and Record.
-
The inventory object classes are all package-private.
-
The static factory Data provides access to
inventory objects.
-
The inventory interface has changed substantially:
-
toCollection has been replaced with two
iterator methods: one is an unsorted
iterator, the other uses the strategy pattern to
return a sorted iterator.
-
The mutator methods of the inventory are all
package-private.
-
To modify the inventory from outside the package,
one must invoke the run method, passing
in a Command object. See the example in
file:myhw2/main/TEST1.java [source] [doc-public] [doc-private].
-
RecordObj is a nested class, emphasizing its
dependence on InventorySet.
-
Since record objects are protected behind the public
interface Record, it is no longer necessary
to copy them -- they canot be modified outside the
myhw2.data package.
-
Complete the incomplete classes (you may wish to paste in
some of your hw-01 solution).
-
Modify your unit tests so that they pass. (There is no
longer any need to test Record).
-
Write the integration test myhw2.main.TEST1.


