
David W. answered 05/21/15
Tutor
4.7
(90)
Experienced Prof
This components (subparts) have combined to begin to look like something that will be useful in real life!
But what components ?? (you might ask – and I hope you have learned how to deconstruct requirements!).
1. data base
a. creation separately from this program or by using ‘add’ in this program
b. this program may ‘delete’ an item once it has been selected
c. when searching for a particular item using it’s key (picture), the rest of its record is accessed
2. the screen (user interface)
a. displays a list of all items in the database
a. [to accept our input] it has two buttons – add and delete
(1) add also allows us to enter data into all the fields of the database for this item (record)
(2) delete removes the selected record from the database
3. our on exit button, rather than just quitting the dialog box, might be nice to preserve the integrity of the database (we will close the file rather than trusting Java to do it)
Yes, rewriting specifications like this is important (and a word processor makes it easy). And I often use tables (called ‘compliance matrix’) that have a second column for each of my points to tell where, by original paragraph or page number, I got the requirement. Actually, a true compliance matrix maps in the other direction – taking the original specifications (those written for the customer) and telling me where my program satisfies the requirement. But, I also like to know the importance of each section of program and to be able to check whether it actually meets the stated requirement.
Important: read my program description and the problem statement’s “do the following” to BE SURE they match.
Now – and I wish more instructors would teach this – develop your program in parts that always work (thus, eliminating wasted “debug” time). Start with a blank dialog box or a dialog box with two buttons that do nothing. Does that program work? If so, great! If not, correct it now before it gets too complicated.
Then, create some variables and display a list in your dialog box. Working? Then, allow the user to click on an item in your list. Still working? Then, redisplay the clicked item. W? Now display “add’ when add is clicked and ‘delete’ when delete is clicked. Still working? Now make one of your variables a picture and rearrange the dialog box to look nicer.
Only now, are you even nearly ready to use a database. Depending on your previous data base experience, this will be easy to difficult. So, similar to this approach so far, only try what you think will work successfully!
Now, in addition to displaying ‘add,’ actually add a record. Similarly for ‘delete.’ When you know that these are working, you can remove the words ‘add’ and ‘delete.’
From here on, it is a matter of testing, polishing, etc. --- because it is still working !!
You should have ample time to not only complete the assignment, but to customize it (by adding your name to the display, selecting nice colors or fonts, etc.).
The key is to rewrite the specs carefully and to develop the program using stepwise refinement.