Newer
Older
labs / tiddlers / content / labs / lab03 / _Labs_03_Project Tasks.md
  1. At the moment the <

    > combobox on the ProductEditor dialog is only displaying some default values and does not contain the categories that have previously been entered into the system.

    • Add another method to the DAO class that returns all of the categories. Name the method getCategories. Add another static collection field to the DAO class for storing the categories. Modify the saveProduct method so that it also extracts the category from the product being saved (using the getter method to get the category from the product) and store it in the new field. Return the new field in the getCategories method.
      • Use a new SimpleListModel object to get the data into the category combobox on the ProductEditor dialog. It is the same process that you used to get the products into the product viewer dialog.
  2. Add a new DAO test to your existing test class to test that your new method returns categories correctly.

  3. Create the following two sequence diagrams using PlantUML.

    • A sequence diagram for the 'add a new product' use case. This diagram should show the flow of interactions from the user clicking the button on the menu, through to the created product object being stored via the product DAO. Don't forget to show the categories being loaded into the combo box.
      • A sequence diagram for the 'view all products' use case. It should show the flow of interactions from the user clicking the button on the menu, through to the dialog being displayed, and the products being loaded into the list.

    Create a new folder in the root of your project named <>. Save your puml files in this folder.

    You can use VS Code in the lab, or your own version (assuming you have the PlantUML plugin installed) to create the diagrams. If you have not taken INFO201 then refer to lab 1 of INFO201 for instructions on installing and configuring VS Code and the PlantUML plugin.

    If you don't have VS Code installed then you may prefer to use one of the following online editors and copy and paste between the online editor and the file in your project (via a different text editor):

  4. Don't forget to complete all four domain classes. The complete domain model including the methods, and relationships is part of milestone 1.

Bonus Tasks

There is bonus task that is relevant to this lab:

  • Make the products appear in your ProductViewer dialog in sorted order (by product ID) when using the collections based DAO. This task is about using sorted collections in the DAO class as described in lecture 5.