• 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

2 questions about the new assignment

 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1.
Description:
They take bookings only within 48 hours of the start of room occupancy.
Column description:
Name ate available
length:10
desc:The single night to which this record relates, format is yyyy/mm/dd.
Q:I don't understand what this mean.
2.It seems that there are no limit for how long the reservation can be kept, Is my understanding right?
Appreciation!
Frank
 
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1) when you validate the booking ensure that the date is within 48 hours of system date.
OR, you could simply not provide any dates that are out of range, i dont have any limit, except that the date must not be in the past, so i provide any rooms starting today but book only rooms within next 48 hours.
2) forget limits here, if he books a room its finished, you simply ignore that record, and it never shows up in your the system again.
the reason there's only one date is because its not an open standing hotel room which can be booked for certain time periods, instead consider the room a one night stand, it gets booked for one night and one night only, and tell your client to leave a fifty on the dresser
 
frank sun
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, you make me clear a lot,
but, should I add one function to let the applicaion to fill in the date which he want to reserve.
regards!
frank
 
Ta Ri Ki Sun
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by frank sun:
Thanks, you make me clear a lot,
but, should I add one function to let the applicaion to fill in the date which he want to reserve.
regards!
frank



you're welcome, but can you please explain to me why you want to add such a method ?
 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Ta Ri Ki Sun,


when you validate the booking ensure that the date is within 48 hours of system date.
OR, you could simply not provide any dates that are out of range,


what do you mean "system date"? One date in my db file is 2004/08/19, then what is the correct time range of
1. within 48 hours of system date?
or
2. within 48 hours of the start of room occupancy?
thanks,
shan
 
Ta Ri Ki Sun
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by shan chen:
Hi, Ta Ri Ki Sun,

what do you mean "system date"? One date in my db file is 2004/08/19, then what is the correct time range of
1. within 48 hours of system date?
or
2. within 48 hours of the start of room occupancy?
thanks,
shan



1 & 2 are answered in one go.
the start of room occupancy should be within 48 hours of system date, the instructions say

They take bookings only within 48 hours of the start of room occupancy


this means you can change your system date to 2004/08/18 or 2004/08/17 and book the room you mentioned above which is available on 2004/08/19.
bear in mind there are no hours, so you cant use 48 hours and should instead use 2 days
 
frank sun
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, so we do not care the date at all, right?
10 questions more:
1.Is it necessary to consider the new hotel adding/delete/update?
2.Do we need to consider canceling the book?
3.After the guest leave the hotel, do we need to consider updating the record?
4.The field 'size' , in the literal meaning is max occupancy of the room, but it is the hotel's max occupancy, right?
5.When the size of certain hotel is reached, the booking for that hotel should failed, right?
6.Do I need to provide the lock/unlock function when running in the standalone mode(3 modes totally, server,client,standalone)
7.What the field 'recordnumber ' mean? there are no any column defined in the db.db file.
8.Should I define 2 classes, one implements the Serialzable, it's for the remote access; the other one does not implements the Serializable, it's for the standalone mode, Right?
9.Do I need to read out the magic cookie number from the db.db file by myself at first, and then take it as the criteria to check whether the db.db file is correct or not?
10.Quoted from the db.db file format description: '1 byte flag. 00 implies valid record, 0xFF implies deleted record'; does it mean that we do only need to mark the to-be deleted record as '0xFF', we do not delete actually, right? and I am confused when should we use the Delete function, which pre-defined in the interface?
Expecting for your help!
Appreciation!
Frank
 
Ta Ri Ki Sun
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by frank sun:
Thanks, so we do not care the date at all, right?
10 questions more:
1.Is it necessary to consider the new hotel adding/delete/update?
2.Do we need to consider canceling the book?
3.After the guest leave the hotel, do we need to consider updating the record?
4.The field 'size' , in the literal meaning is max occupancy of the room, but it is the hotel's max occupancy, right?
5.When the size of certain hotel is reached, the booking for that hotel should failed, right?
6.Do I need to provide the lock/unlock function when running in the standalone mode(3 modes totally, server,client,standalone)
7.What the field 'recordnumber ' mean? there are no any column defined in the db.db file.
8.Should I define 2 classes, one implements the Serialzable, it's for the remote access; the other one does not implements the Serializable, it's for the standalone mode, Right?
9.Do I need to read out the magic cookie number from the db.db file by myself at first, and then take it as the criteria to check whether the db.db file is correct or not?
10.Quoted from the db.db file format description: '1 byte flag. 00 implies valid record, 0xFF implies deleted record'; does it mean that we do only need to mark the to-be deleted record as '0xFF', we do not delete actually, right? and I am confused when should we use the Delete function, which pre-defined in the interface?
Expecting for your help!
Appreciation!
Frank



1) I wont consider adding/deleting, but updating is necessary or you cant book the room
2)No
3) No
4) It is how many people can sleep in that particular room
5) wrong, the size has nothing to do with the booking, we've discussed this at length in another thread a few days ago here...thread regarding occupancy

6) Not sure, theres different opinions on that one, but I will likely
7) have a look around the forum, theres at least 2 threads discussing this going on right now
8)yep
9) thats one way to do it, you could implement all sorts of methods that check the file and the integrity of the data before you run if that pleases you
10) yes thats what it means, if you will provide facility to delete, my assignment does not ask for it and i plan to code only what it asks, just as the instructions say
 
frank sun
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First, thanks for your comments here!
As to the item 8, we need to create 2 classes for remote and standalone modes, but I didn't find that in somebody's design, which was published in the forum.
I think we can just create the class that implements the seriazable only, for the remote and standalone, does that conflict with the instruction?
Frank
 
frank sun
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There in the instruction, it says
'In standalone mode,must not involve the serialization of any objects when communicating between the GUI and database elements.'
Does it mean I have to create 2 classes to meet the network and non-network modes?
Comments,please!
Frank
 
frank sun
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Waiting for...reply
Frank
 
Ta Ri Ki Sun
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by frank sun:
There in the instruction, it says
'In standalone mode,must not involve the serialization of any objects when communicating between the GUI and database elements.'
Does it mean I have to create 2 classes to meet the network and non-network modes?
Comments,please!
Frank


this depends on your design entirely, because if all your network server is returning and passing is String[] for example then theres no need to implement Serializable , heres the String class from API
Class String
java.lang.Object
|
+--java.lang.String
All Implemented Interfaces:
CharSequence, Comparable, Serializable

you'll note it already implements Serializable , so theres no point making some object that implements Serializable when you dont need it, but if you need an Object called record for example, which is passed and sent using RMI then it must also implement Serializable , which means you'll then have RecordLocal and RecordRemote because RecordLocal does not need to implement Serializable.
if you want to know more about RMI heres a very good tutorial
Sun RMI Tutorial , and if you search the web you'll find many more, also search for RMI here in the javaranch forums, most of the time you'll find all your questions already answered
 
frank sun
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot!
I will re-think my design according to your idea.
Frank
 
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I cannot see why you need a RecordLocal if you already have a Serializable RecordRemote. Serializable is a marker interface, there are no methods to implement. A String and a String[] are both Serializable but you don't have to have a local version of String or String[] to use them as parameters to a local method call.
Or am I missing something here?
The assignment is saying that you must not serialize (marshal/demarshal) the objects in local mode, not that you must not mark the classes as Serializable.
[ April 18, 2003: Message edited by: Barry Gaunt ]
 
frank sun
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That sounds so great, so I just don't have to create 2 classes, one implements seriazable, the other does not, and in the local mode, I must not call the seriazable method.
Thanks!
Frank
 
Ta Ri Ki Sun
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by frank sun:
That sounds so great, so I just don't have to create 2 classes, one implements seriazable, the other does not, and in the local mode, I must not call the seriazable method.
Thanks!
Frank


Barry is right, but you've misunderstood him, and theres no such method to call or not call, the serialization is transparent to you
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Ta Ri Ki Sun for clarifying that for me. By the way, what do your friends call you? Ta? Ta-Ri? Ta-Ri-Ki? Sorry, I am unfamiliar with non-european naming convention.
-Barry
 
Ta Ri Ki Sun
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Barry Gaunt:
Thank you Ta Ri Ki Sun for clarifying that for me. By the way, what do your friends call you? Ta? Ta-Ri? Ta-Ri-Ki? Sorry, I am unfamiliar with non-european naming convention.
-Barry


Most of my mates call me TQ, so you're welcome to call me that
 
frank sun
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks TQ,
I guess I understood you.
Is there any forum discuss the pattern MVC?
best regards!
frank
 
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Frank,
MVC gets discussed quite often in this forum. A good example is Topic: Confused with MVC.
This thread also has a link to the MVC blueprint at Sun.
Regards, Andrew
 
frank sun
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank You!
Frank
 
I can't beleive you just said that. Now I need to calm down with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic