Ew, Roel said almost the same already (I left this reply window open for a while)
Sean Keane wrote:
The DB interface has no mention of the find-method not returning booked rooms. So should the find-method return booked rooms?
No, I think
you should leave the data layer for what it is. You can search for records by calling the find method. This find method should not contain business logic, like filtering out undesired search results.
Sean Keane wrote:
I am guessing that the GUI should not display booked rooms, right? So if the find-method should return booked rooms and the GUI should not display booked rooms, then where do you guys filter out the booked room? In the business class?
The specs do not say anything about this. I just show them in my JTable. However, when a CSR clicks on a row that is already booked he can't book it anyway. I disabled the book button and I also have a validation in the business layer. If a CSR wants to book room x, I read room x and check if room.getOwner() != null.