• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Booked Rooms

 
Sean Keane
Ranch Hand
Posts: 588
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I thinking about how do deal with booked rooms - wondering if you guys had any feedback\ideas?

The DB interface has no mention of the find-method not returning booked rooms. So should the find-method return booked rooms?

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?
 
Roel De Nijs
Sheriff
Posts: 10591
140
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My GUI displays booked rooms. When you select a booked room, the Book-button will be disabled.

There is no requirement to filter out booked rooms, so why would you do that anyway. And what if in a next version you have to add unbook-functionality?
 
Dennis Grimbergen
Ranch Hand
Posts: 159
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Matthew Brown
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I also returned them all to the client. I did actually - and this really isn't necessary - add a table filter allowing the user to show only booked or unbooked rooms as well as an unfiltered list, but I felt if you were going to do that it should be in the UI instead of the business service (and definitely not in the DB interface, which I wanted to keep entirely ignorant of what it was being used for.
 
Sean Keane
Ranch Hand
Posts: 588
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cheers guys! All sound opinions. Displaying booked rooms in the GUI is the way to go
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic