Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NX: owner and Maximum occupancy

 
shan chen
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a 8-byte field called "owner" in db file:
"The id value(an 8 digit number) of the customer who has booked this room. Note that for this application, you should assume that customers and CSRs know their customer ids. The system you are writing does not interact with these numbers, rather it simply records them. If this field is all blanks, the record is available for sale."
Another field called "size" is "the maximum number of people permitted in this room", like size = 4.
I am confused here: should one client rent the room as a whole, or rent one bed in the room?
If the latter is the case, how to put two owner ids in one field "owner"?
If the former is the case, we do not need to decrease 4 to 3 after a client booked the room, as the whole room is booked.
Any suggestion?

Thanks.
chen
 
Ta Ri Ki Sun
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is an assumption but my understanding is that you book a room, how many people the room sleeps is of no importance to you, and only of use to the client booking the room, these are not communes/hostels they're booking, they book rooms, so the client would consider booking a room that his entire family can occupy comfortably
 
Ta Ri Ki Sun
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the former is the case, we do not need to decrease 4 to 3 after a client booked the room, as the whole room is booked.

correct me if I'm wrong here but I believe the only field you update is the client ID, other than that theres nothing to update, as i said if he's booked the room its his and his only.
 
Thomas Kijftenbelt
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
In the "home constructor" assignment you have more or less the same issue: a contractor has a number of employees, and a customer can book a contractor.
My understanding is that when a customer books a contractor, the customer field is updated with the customer number, and the number of employees available is decreased by one (or in your case: the number of beds is decreased by one).
Greetings,
TK
 
Sun qinlong
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all
in my opintion , the user booked a whole room at one time instead of one bed. the user can choose the room by the number which conforms to them. and it dosent to decrease the number .and the room is aviable one night depend on the data
I think this will clear you ///
 
Michael Dreese
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Thomas Kijftenbelt:
My understanding is that when a customer books a contractor, the customer field is updated with the customer number, and the number of employees available is decreased by one (or in your case: the number of beds is decreased by one).

I don't think we have to decrease the number of employees available in the record.
Correct me if I'm wrong. Let's look at this way, if you have to book the specific contractor, your id will fill up the custmer id field in the record. And there is only one record per contractor. Therefore, I would think when you do booking, you have to book the whole contractor (one record).
Cheers,
Michael
 
shan chen
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I perfer the choice that one book the room as a whole. The size does not change.
The reason I asked this question is that it is different from "old" assignment, in which "booking" means decreasing the available item number.
A further question related with owner: how to display owner in JTable?
1. just display the owner id. ( privacy concern?)
2. display "occupied" if there is an owner id.
display "available" if no owner id.
any suggestions?
chen
 
Werner Joerling
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by shan chen:
...
A further question related with owner: how to display owner in JTable?
1. just display the owner id. ( privacy concern?)
2. display "occupied" if there is an owner id.
display "available" if no owner id.
chen

Chen,
there arise more questions:
3. Do we need an "unbook" functionality? That means updating the db with an emty owner. The instructions only require the "book"-functionality.
4. The instructions say:
"The system you are writing does not interact with these numbers, rather it simply records them."
But where the customer numbers are coming from?
Does the booking CSR type it in a text field? That is not the thing I would understand as not interacting with these numbers.
Werner
[ April 12, 2003: Message edited by: Werner Joerling ]
 
Ta Ri Ki Sun
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Werner Joerling:

Chen,
there arise more questions:
3. Do we need an "unbook" functionality? That means updating the db with an emty owner. The instructions only require the "book"-functionality.
4. The instructions say:
"The system you are writing does not interact with these numbers, rather it simply records them."
But where the customer numbers are coming from?
Does the booking CSR type it in a text field? That is not the thing I would understand as not interacting with these numbers.
Werner
[ April 12, 2003: Message edited by: Werner Joerling ]

3. No , I certainly wont code anything thats not required to complete my specifications.
4. "It simply records them" does in fact mean you take it in from a text field when booking, and that idea is supported by the fact that an empty client ID means the room is available, assuming its not marked as deleted.
so if you book a room and dont capture a client ID you'll never really book the room
 
Ta Ri Ki Sun
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
one more thing about point #4, not interacting with the client ID to me simply means i dont perform validations besides checking its length, and not checking its validity against another table to ensure the client exists etc
 
Werner Joerling
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ta Ri Ki Sun:

4. ... so if you book a room and dont capture a client ID you'll never really book the room ...

If you accept an emty client id and overwrite a non-empty client id with it, you will in fact unbook the room/contractor.
 
Ta Ri Ki Sun
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Werner Joerling:

If you accept an emty client id and overwrite a non-empty client id with it, you will in fact unbook the room/contractor.

this is true but does your assignment ask you to unbook the room?
mine doesn't, not only that but it also says you can expect the clients/users to know their 8 digit numbers, this to me says check for 8 digit number when booking, and disallow an empty value or value shorter than 8 in length, and by doing so there is no booking cancellation, and for me this is fine because my spec doesn't ask for facility to cancel booking
 
Sun qinlong
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh myfriend!!
remember that this is only a assegnment not a real application . complete the requriement form the document is enough.
and i will not provite the unbook method
 
Thomas Kijftenbelt
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
don't think we have to decrease the number of employees available in the record.
Correct me if I'm wrong. Let's look at this way, if you have to book the specific contractor, your id will fill up the custmer id field in the record. And there is only one record per contractor. Therefore, I would think when you do booking, you have to book the whole contractor (one record).

the description for the record says: the number of workers available when this record is booked.
this suggests that you have to do something with this field...
I think it is correct that only one customer can book a contractor; and probably unbooking is done by clearing the customer field.
greetings,
TK
 
Werner Joerling
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Thomas Kijftenbelt:

this suggests that you have to do something with this field...

So I believe too. I think it is too simlple only to write the customer id in the owner field. I suspect there must be a complication. But I have no idea.
 
Thomas Kijftenbelt
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
My guess is that you:
- write a customer id in the owner field (in the jtable) to book a contractor (or room), and as a result the number of available contractors is decreased by one... the jtable should be updated to reflect this change.
- remove a customer id from the owner field (in the jtable) to unbook a contractor (or room), and as a result the number of available contractors is increased by one... the jtable should be updated to reflect this change.
to keep things easy, I would suggest to allow only one customer to book a contractor (even if there are more employees available) -> i.e. the customer field can only contain ONE customer ID.
greetings,
TK
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic