This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
Originally posted by tim parks: Hi There is a 1 byte flag for valid/deleted records in the datbase format. I presume I'm expected to parse this and only show valid records in the GUI's JTable?
I suspect that you've not yet thought about your Database class otherwise you wouldn't have asked this question The reason is that the delete flag is just an implementation detail of how your "database" handles deleted records. Your "select" queries will never return deleted records. In other words, since your Database class will never return deleted records (because logically they don't even exist), your GUI does not have to worry about it. Yes, some code will be there to parse this byte and to determine whether it is a deleted record or not. But this code will not be a part of the GUI. Do you see the point?
Originally posted by tim parks:
Once I've booked a contractor, should that contractor still be displayed? There is no mention in the assignment about unbooking a contractor to make it availible for others to use,
any thoughts? thanks Tim
"There is no mention in the assignment ....", there you said it You are free to do what YOU think is appropriate. You can either show it in the GUI with the booking info in one of the columns (in this case, you'll also prohibit booking it.) or you can just not display any records that have been booked. Neither is wrong. But whatever you do make sure you make a note of it and explain why you decided to do it.