In order to complete this lab you should be familiar with the following:
You should also know the guts of User Interface package.
1. From Netscape, save the User Interface package (UI.st), Vending Machine PDC Classes (vending.st) and Vending Machine HIC Classes (vendview.st) to your account (follow the links above and choose "Save as..." from the "File" menu of Netscape for every file you want to save).
2. Start Visual Works from the directory you saved the files to:
visual &
3. File UI.st, vending.st, and vendview.st in.
4. Type:
Item vendingMachineDemoin the System Workspace, hightlight it, and "do it".
Your screen should look approximately like Figure 2-30, p.198 in the Coad & Nicola book. Play with the demo for a while to get a feeling of what's going on. Try to identify the elements of the picture with the corresponding classes in the Vending Machine class hierarchy. Ask yourself questions like: "What is the controller element here?" or "What is this view built for?" and try to answer them. It is extremely important to understand the relationships between different classes in the Vending Machine in order to do the next part of the lab.
Hint 1: you will have to modify ItemViewContainer and, perhaps, DispensingHolder classes in order to complete this lab.
Hint 2: the modifications will include at least the following:
Hint 3: by doing only that you will be able to display just the number of items available without any info as to what that number means. The info could look like this: 'Available: 3'. Displaying something of that kind is more tricky than it seems: when the number of items changes, you have to notify all the dependents about it. Look at the method 'vendTheDispensableItem' in the category 'view access' of DispensingHolder.
File out all the Vending Machine classes (you don't need to file out User Interface package) and turn them in.
cat Vending.st VendingViews.st | mail -s "Lab 4 - YOUR NAME" cs2390@prism.gatech.edu
Please quit from VisualWorks before you logout!!