labs / tiddlers / content / labs / lab06 / _Labs_06_Project Tasks.tid
created: 20200702091026430
modified: 20200707005526287
section: 7
tags: lab06 lab
title: /Labs/06/Project Tasks
type: text/vnd.tiddlywiki

Milestone 2 is due at the end of next week (Friday 27<sup>th</sup> August at 5:00pm).

This week's lab does contribute towards milestone 2, however next week's lab (lab 7) is part of milestone 3, so does not count towards milestone 2.

Also note that Mark is going senile and forgot to include the testing from milestone 1 in his marking schedule (for the second year in a row).  We will now mark the milestone 1 tests as part of milestone 2.  If you did not complete the testing for milestone 1 then you now have an opportunity to complete it and still get marks for it.

!! Input Validation

Add input validation to the rest of your product fields as shown in this lab.  All of the important string fields should not allow null, or blank values.  All numbers should not allow null values, or negative numbers.

What we are aiming for is that a user should not be able to cause an exception stack trace to appear in the output console by either entering incorrect values or just not entering values at all into the fields on your user interface.

Thoroughly test your system to see if there is any way that the user can cause an exception stack trace to appear in the output console that doesn't also cause a pop-up message to appear, or otherwise break the system.  If you have done a good job of the validation an pop-up error handling there should be no way to crash your system without at least an error message box being displayed to the user.  In a production system the user will not see an output console so will never see any printed stack traces or error messages --- message boxes are your primary mechanism for warning users when an error has occurred.

Note that you will sometimes see both a pop-up message box and an exception stack trace in the output pane.  This is because the `DaoExceptionMapper` class is explicitly logging the exceptions for the cases that we consider may be caused by bugs.  This should only happen in fairly extreme situations though (such as the database being closed while the application is running) --- there shouldn't be exception stack traces being displayed under normal usage (such as a user entering bad input).

!! Sequence Diagrams

As per section [[4.4.2|]] of the project specification, you need to create UML sequence diagrams for the delete, search by ID, and filter by category use cases.

Since you now have a database-backed DAO, your diagrams should include the database and the SQL statements that are executed in response to DAO methods.

Each use case should be in a different diagram and stored in a separate PUML file inside your project's diagrams folder.

To give you an idea of what we are expecting, the following is an example of what the 'add new product' diagram looks like now that we have a database, and DAO injection (click for the source):

<a target="_blank" href="">{{/Labs/06/images/Save Product Sequence Diagram}}</a>