(Hotel booking assignment) Is anyone implementing something where the server will notify clients when data has changed? In other words, a client has performed a search and has a list of hotel dates available. Over time, this data becomes old. If the client sits for ten minutes, it's possible that many of the dates in the list are no longer available because other clients have reserved them. So the server could send a message to the client whenever a reservation is made, allowing the list to stay accurate. Another variation to the server-notification would be something like a timed refresh on the client end. Or the client could be required to press a button called "refresh" to obtain the latest data. Any comments?
Hi Perry, What do your requirements say about dated data? The old assignment had the following:
It is not necessary to provide for live updates on multiple clients when new bookings are made at other clients.
Under these guidelines you could implement your solution, but remember two things: You Arent Gonna Need It (YAGNI). Trying to implement what you think might be a future requirement can be a wasted effort. The more you go out of scope, the more the examiner has to pick at (and could therefore cost you marks). Regards, Andrew
Hi Frank, You said: is it ok to book the already booked room? I guess if it is not explicitly disallowed then you could do it, as long as you give a message that you are now bed sharing Seriously though, this is where the record locking comes in: at the time you want to book the room, you should lock the record, confirm that it is still vacant, book it, then unlock it. This is what happens in real life - normally clients do not get live updates when data changes. Think about a normal hotel offering rooms for the night. Now think about how many travel agents there are in your town who may be able to offer those rooms to you, Multiply that through all the towns and all the cities in the world, and you quickly realise that sending all updates to all the agents would be impossible. Likewise tracking which agents are inquiring about certain numbers of rooms over certain numbers of nights would be a nightmare. Regards, Andrew
Thanks for responding, Andrew. My Sun assignment makes no mention of live updates. I am probably not going to include such a feature. I'll probably just do a check before the record is booked and if someone happened to jump ahead of another client, I'll display a message to the user saying something to the effect that the room is no longer available.
This tiny ad is suggesting that maybe she should go play in traffic.