Win a copy of Serverless Applications with Node.js this week in the NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

Booked Rooms  RSS feed

 
Ranch Hand
Posts: 590
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?
 
Sheriff
Posts: 11604
178
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?
 
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.
 
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: 590
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
 
F is for finger. Can you stick your finger in your nose? Doesn't that feel nice? Now try this tiny ad:
global solutions you can do in your home or backyard
https://coderanch.com/t/708587/global-solutions-home-backyard
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!