• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

taking bookings only within 48 hours of the start of room occupancy

 
Mike Tilling
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1- It was mentionned in my Assignement (UrlyBird) : “They take bookings only within 48 hours of the start of room occupancy”

-I understand that:

-If the room is ready for today, it can be booked
-If the room is ready for tomorrow, it can be booked
-If the room is ready for the day after tomorrow, it can not be booked

-am I wrong?

-can I book a room for a date which is prior than today + 48 hours?

[Andrew: Changed subject line to something more meaningful]
[ July 01, 2006: Message edited by: Andrew Monkhouse ]
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mike


It is simple :

A record gets aviable on a certain date and the booking can be booked with 48 hours (or two days) before this date.
If the 48 H interval is out the room is can not be booked.

so


-If the room is ready for today, it can be booked

only half right the room is available if it has no owner(the owner field is empty)


If the room is ready for tomorrow, it can be booked

OK


-If the room is ready for the day after tomorrow, it can not be booked

Wrong,the room can be booked because we are still in the 48 hours interval


Regards M.
[ July 01, 2006: Message edited by: Mihai Radulescu ]
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12007
215
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mike,

We recommend that you do not address questions to an individual person - that individual may be away / sick / busy / ... If you leave the question open to everybody then usually somebody will answer. In this case Mihai did an excellent job of answering your questions.

Personally I try to avoid being the first person to answer any post within 24 hours of it being posted - once 24 hours are up I will usually answer any question that has not already been answered, or that I think is going off the rails (but I have been very sick this week so I havent done this). My reasoning is simple: in the past I used to answer every question as soon as it was posted, and for a while it appeared that I was the only person answering questions in this forum - by backing off I am allowing others to express their opinions.

can I book a room for a date which is prior than today + 48 hours?


There could be a technical reason for allowing it: what if you catch a flight that crosses the international date line?

My example of this used to be: I live in Sydney, and want to fly to Honolulu today (I want to fly there anytime ). The flight I catch is QF 003, departing Sydney at 10am on 12 May, and arriving in Honolulu at 23.30 on 11th May.

That particular example doesnt work anymore, since Qantas changed QF 003 to fly at a different time, but you get the point. It also is no longer true since I no longer live in Sydney but that is off topic

It could be technically possible today for someone to want to book a room yesterday. So you can allow it in your program. Or you could decide not to allow edge cases like this (especially since you might then be opening a can of worms in determining what is allowable in the past and what is not). Could be a design decision - something that you make a decision on and document

Regards, Andrew
[ July 01, 2006: Message edited by: Andrew Monkhouse ]
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys

Andrew,

I think that this problem may occur if the client an the server are in different times zones.
So I think that somewhere on the middle tier must be some sort of date translator GMT to UDF but this make our task more complicated and this a little over the certification purpose (IMHO).

So I have two(OK three, or maybe four) chances:
1.Ignore it - the server and client are in the time zone.
2.Build a flexible time rule (something with days before and days after) and let the system administrator to decide how to use it
3.Take care of different time zones(so the server and the client must be able to manage&manipulate this kind of information) on the middle tier.
4.Build an agent which take care about date.

I chose a mixture about 1 and 2. I have a flexible time rule with the default values fitting the 48 hours rule (from my specs).
The disadvantage is that this solution fails for clients in different times zones.

What you think ?


Regards M
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12007
215
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mihai,

Sounds like you have made a design decision

In reality, Sun arent really interested in a complex design, but they are interested in whether you have considered the issues or not (potentially the difference between a "developer" or a "programmer"). So the mere fact of documenting that you are aware of the problem(s) in your design decisions document can be enough.

Regards, Andrew
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Andrew, ThanX for tip(s)

Regards M
 
Eva Van Shtock
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

Cannot you just put the logic in the server?
The database does not have anything about the time zone of the second field,
so there is no way but to have a single time reference.

Eva
 
Mike Tilling
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

always with the statement, "they take booking only within 48 hours of the start of room occupancy"

-Is there any restriction on the booking date? The restrion I made is:
bookingDate must be after the available date and (equals or after the today date)

am I wrong?
can the booking date be one month or one year or more after the today date?

Best Regards
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic