1. In the Server part, the question paper provides us a MUST implement interface DBMain, can I edit it? What I mean is, for example, change the // comment to javadoc comments, add the necessary packages, like Regular expression to the interface, etc. Of course, the original methods and their arguments will be kept as it is.
2 byte flag. 00 implies valid record, 0x8000 implies deleted record
1. Should I change the empty bytes to "00", when my application first load?
2. Does all records (total no. of Hotels) fixed?
3. Since the user can book a selected recorded, so how if, the record is already be booked? Simply reply room is not available?
4. If 3 is the case, then are there any "add" function in fact? Seems to me that there is only update function, when a booking of the hotel is cancelled.
If a customer book a room, would you add 1 more record,
2. Since the function read(int rec_id) requires a record id, do we store it into the data file? OR we just count it in this way:
3. For data object, does it read the data from data file every time? OR it reads all records into the memery and access it via memory every time?
No. If a customer books a record, you set the owner field to the customer id. If the record field "owner" is set to a value, it is booked. You don't need (and may not!!!) any new record after that.
Let's take a sample: you book a record #17. Yout set its owner to #xxx. That is it.
...customer "cancel" a booking
That is to say, for the user, we just need to give them the function "book" and "search".
However, we need to implement all functions given according to the spec, even those will not be used by the user?
do you mind telling me that how many classes you have developed
do u create a RecordAdpator class to encapsulate the String?