File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes 2 questions about the new assignment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "2 questions about the new assignment" Watch "2 questions about the new assignment" New topic
Author

2 questions about the new assignment

frank sun
Ranch Hand

Joined: Apr 11, 2003
Posts: 102
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
Ta Ri Ki Sun
Ranch Hand

Joined: Mar 26, 2002
Posts: 442
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

Joined: Apr 11, 2003
Posts: 102
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

Joined: Mar 26, 2002
Posts: 442
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 ?
shan chen
Ranch Hand

Joined: Apr 09, 2003
Posts: 70
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

Joined: Mar 26, 2002
Posts: 442
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

Joined: Apr 11, 2003
Posts: 102
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

Joined: Mar 26, 2002
Posts: 442
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

Joined: Apr 11, 2003
Posts: 102
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

Joined: Apr 11, 2003
Posts: 102
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

Joined: Apr 11, 2003
Posts: 102
Waiting for...reply
Frank
Ta Ri Ki Sun
Ranch Hand

Joined: Mar 26, 2002
Posts: 442
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

Joined: Apr 11, 2003
Posts: 102
Thanks a lot!
I will re-think my design according to your idea.
Frank
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
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 ]

Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
frank sun
Ranch Hand

Joined: Apr 11, 2003
Posts: 102
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

Joined: Mar 26, 2002
Posts: 442
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

Joined: Aug 03, 2002
Posts: 7729
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

Joined: Mar 26, 2002
Posts: 442
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

Joined: Apr 11, 2003
Posts: 102
thanks TQ,
I guess I understood you.
Is there any forum discuss the pattern MVC?
best regards!
frank
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11404
    
  81

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


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
frank sun
Ranch Hand

Joined: Apr 11, 2003
Posts: 102
Thank You!
Frank
 
wood burning stoves
 
subject: 2 questions about the new assignment
 
Similar Threads
exclude-list usage
insight and sage advice (on JUnit)
Java One conference...
WA #1.....word association
How to log java.exe errors in bat file