I understand that the room can be booked if the owner is not empty regardless of what the date (available date) is.
I want to set clear that this is what my
createRecord(String[] data) method does. And it is this way because I do not like to enforce business rules in this level of my implementation.
My Data class is unaware of business rules or data types. Therefore, all that I do at this level is to enforce the number of columns; and all I do is to check that the provide data array passed to the
createRecord() actually contains as many fields as columns are defined in the database metadata. My implementation of
createRecord() also checks if any of values of the array is a null item and replaces it for an empty String.
Wrapping up, if somebody used the plain method
createRecord(), this person could create a record that is booked without the 48 hours of availability. However, in my implementation of the URLyBird assignment, the client applications do not use the Data class directly.
I have wrapped the data class into a more intelligent business-aware and data-type aware class which is, ultimately, the class that will be exposed in the RMI registry.
The unbook reset the owner regardless of the date value.
Now, I have not implemented unbook, but if I had done it, I would only let to unbook records within the same 48-hours of availability that are valid to book them. Namely, if a record is not valid to be booked, I would not make it valid to unbook.
If date is after today +48 hours and the owner is empty, will the room be ready for booking?
I would say it is not. I am yet working on that, but I believe that, probably, I will use different colors to distinguish the different type of records, old records, available records, and records that will be available in the near future.
[ October 10, 2006: Message edited by: Edwin Dalorzo ]