This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have a question about the modify(DataInfo info) method in the Data class. Which fields of the database are allowed to be modified by the client? The flight number and the number of free seats are definitely not to be modified directly since the first is the primary key and the latter is to be modified by the bookFlight() method. What if the administrator had to change some flight info such as the time or the duration or for that matter the origin/destination? Any response is appreciated. Regards, Pallav
If I remember correctly, pretty much any field can be changed by the client. Obviously, if you change the flight number, you won't be able to modify anything because the record can not be identified. All the method does is find the related DataInfo object, checks it, and replaces it with the one passed through the method. Your bookFlights method will have to either modify the DataInfo then resend it, or create a new DataInfo based on the information in the old one with modified flight numbers. Hope that helps
Adam Roberts - SCJP2, SCJD<br />insert witty something here