• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

UrlyBird: user input

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm curious on my assignment (URLyBird 1.2.2) on the way how yoy guys handle the booking/unbooking of rooms.

I wonder which input do you request from the user when booking a room besides the 8 digit customer id. Do you for example ask the user to input the number of accommodations for the room?

And if you do, I wonder how you handle tihe unbooking of a room? When a room is booked lets say for 5 days, when do you let the user unbook the room? The booking period might be shorter, longer than requested. How do cope with it?

Thanks for helping.
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Alex,

I took a very simple approach:
  • no unbooking (not required by the instructions)
  • when user selects a room from the table (and that room isn't booked already) and clicks the book button, a dialog is shown which requires a valid customer id. When the user confirms this dialog (click ok button), the booking process starts (locking the record, checking if no other client already booked that room,...).

  • That's it. Pretty easy, isn't it

    Kind regards,
    Roel
     
    Axel Leucht
    Greenhorn
    Posts: 21
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi Roel,

    thanks for you're input.

    Do I understand you correctly that once you booked a room you can't book it again (and it stay booked forever) as it is now booked?

    I reread my assignment and indeed the unbooking method isn't required, but this seems to be weird to me, isn't it?
     
    Bartender
    Posts: 3648
    16
    Android Mac OS X Firefox Browser Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Axel Leucht wrote:Do I understand you correctly that once you booked a room you can't book it again (and it stay booked forever) as it is now booked?

    I reread my assignment and indeed the unbooking method isn't required, but this seems to be weird to me, isn't it?



    Hi Axel, the assignment really requires the book and search methods. Once a room is booked, it is booked. You may provide a unbook method for the client UI but that's not necessary. If you asked about the book method, you may also wondering what about the delete method (like once a room is created, can I delete it).

    In my implementation of UB I provided book/unbook, search, create/delete methods. Again the delete method is not necessary. Now regarding your earlier post about when to you allow a room to unbook itself... I did mine as anytime. Meaning once I book it, I can immediately unbook it. You may noticed the 48-hour window for booking rooms. I used this info to set the date also. Some people just ignore the date when booking rooms.
     
    Roel De Nijs
    Sheriff
    Posts: 11604
    178
    Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi Axel,

    The assignment is more than complicated enough, so I did only what was required:
  • only find and book available from the gui
  • my data class has implementation for all methods (create, delete, read, update,...), but only a few (read, find, update, lock,...) are invoked somewhere in the program.
  • did nothing with the 48 hours rule, except mentioning it in the choices.txt why i didn't handle it.


  • So you can now implement unbook functionality and do a lot of thinking about it, with some rules. And then the business guys come up with a whole other set of rules for unbooking a room, so all your work will be gc'ed

    They asked for finding rooms and booking a room, so that's what they got. And indeed it's a bit weird, but you won't get any extra credit/points for doing more than what's expected, you may even lose some points...

    Kind regards,
    Roel
     
    Don't get me started about those stupid light bulbs.
    reply
      Bookmark Topic Watch Topic
    • New Topic