aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes NX:Hotel-room booking system Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "NX:Hotel-room booking system" Watch "NX:Hotel-room booking system" New topic
Author

NX:Hotel-room booking system

Nick Lee
Ranch Hand

Joined: Dec 17, 2002
Posts: 45
hi all,
My assignment is a hotel room booking system.I wanna find some friends who get the same assignment with me and share some information with them.
I'm a Chinese guy,just forgive my poor English.

[ April 13, 2003: Message edited by: Nick Lee ]

Nick Lee
frank sun
Ranch Hand

Joined: Apr 11, 2003
Posts: 102
hi,
there is the parameter:recordnumber,defined in the interface method,what that mean?
shan chen
Ranch Hand

Joined: Apr 09, 2003
Posts: 70
Hi, Sun,
Here is a message about record number.
http://www.coderanch.com/t/183198/java-developer-SCJD/certification/NX-No-Primary-key
Wagner Danda Da Silva Filho
Ranch Hand

Joined: Mar 21, 2003
Posts: 80
Originally posted by Nick Lee:
hi all,
My assignment is a hotel room booking system.I wanna find some friends who get the same assignment with me and share some information with them.
I'm a Chinese guy,just forgive my poor English.

[ April 13, 2003: Message edited by: Nick Lee ]

Hello!
I also have the hotel room booking assignment! If you have any question let-me know!
PS: I�m a Brazilian guy trying to find a Java Job at Canada (where all my family will live after August )


SCJP, SCWCD
Nick Lee
Ranch Hand

Joined: Dec 17, 2002
Posts: 45
hi Frank,
You know there are 18-20 records in ur db.db file,right?
and each record has it's number,like the record in the first line is No.1,that's the recordNumber.
Nick Lee
Ranch Hand

Joined: Dec 17, 2002
Posts: 45
hi Wagner,
I got many problems about my system.
1 how to identify the "owner" field in db.db,does it need to input sth in the Gui and then write into the db.db?
2 I'm using MVC patterns,do u have any experience on that?
3 ...when I remember ....I'll ask u at once
Nick Lee
Ranch Hand

Joined: Dec 17, 2002
Posts: 45
hi Wagner,
What do u think of the field "Date" in db.db file?
what should I use this field?
thanks alot
PS:I'm also wanna immigrate to Canada,maybe we can share our feeling of that
frank sun
Ranch Hand

Joined: Apr 11, 2003
Posts: 102
About the field 'Date', you can refer to:
http://www.coderanch.com/t/183230/java-developer-SCJD/certification/questions-new-assignment
Also, there are more questions, and waiting for your comments.
Ps, If I use the RMI to implements the network server function, Do I need to descible how to start up the rmiregistry in my Readme.txt file?
Frank
shan chen
Ranch Hand

Joined: Apr 09, 2003
Posts: 70
Hi, Frank,
One way is to code the rmiregistry set up in a class. If you require manually set up, I think it is necessary to document the process in readme.txt.
shan
Wagner Danda Da Silva Filho
Ranch Hand

Joined: Mar 21, 2003
Posts: 80
Originally posted by Nick Lee:
hi Wagner,
I got many problems about my system.
1 how to identify the "owner" field in db.db,does it need to input sth in the Gui and then write into the db.db?
2 I'm using MVC patterns,do u have any experience on that?
3 ...when I remember ....I'll ask u at once

1 -> The spec says: "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."
2 -> I have no experience on using MVC or any other... I don�t even know how to start with desing of the GUI. But I�m reading a lot of things hopping to understand GUI designs patters very soon.
3 -> Ok! I�ll try to help you!
Wagner Danda Da Silva Filho
Ranch Hand

Joined: Mar 21, 2003
Posts: 80
Originally posted by Nick Lee:
PS:I'm also wanna immigrate to Canada,maybe we can share our feeling of that

Very good to know! Maybe we can be co-workers.
frank sun
Ranch Hand

Joined: Apr 11, 2003
Posts: 102
Hi,shan
So, Could you show me a code snippet how to start up the rmiregistry?
And, quoted from instructions:'In non-network mode, must not involve the serialization of any objects when communicating between the GUI and database elements.',
what that mean?
Appreciation!
thanks!
Nick Lee
Ranch Hand

Joined: Dec 17, 2002
Posts: 45
hi Wagner,
Now,I'm considering what will happen after I click the "order" button,after list all the rooms which match the criteria.
I think,I will write a flag to mark if a room has been ordered,right? so after click order button,I think I'll write the customer id into the db file and set the ordered flag for that room,that's all.
Am I right on that oponion?
Wait for ur suggestion
PS: do u have any chatting tools? MSN or others,can u share ur account with me,I got MSN account and on line all the time,when I m on working.
Ta Ri Ki Sun
Ranch Hand

Joined: Mar 26, 2002
Posts: 442
Originally posted by frank sun:
Hi,shan
So, Could you show me a code snippet how to start up the rmiregistry?
And, quoted from instructions:'In non-network mode, must not involve the serialization of any objects when communicating between the GUI and database elements.',
what that mean?
Appreciation!
thanks!

heres a link to an example i applied to my application and got running in minutes
RMI/Adapter tut on javaworld
that link points to the 3rd page, there're 2 pages before it
[ April 16, 2003: Message edited by: Ta Ri Ki Sun ]
Wagner Danda Da Silva Filho
Ranch Hand

Joined: Mar 21, 2003
Posts: 80
Originally posted by Nick Lee:

...
Now,I'm considering what will happen after I click the "order" button,after list all the rooms which match the criteria.
...

Nick, what do you mean with "order button"? I don�t see anything about this button on the spec. Sorry if I�m not undertanding you...
Nick Lee
Ranch Hand

Joined: Dec 17, 2002
Posts: 45
hi Frank,
I can answer ur question.
the non-network mode is a "local" model,which has not any rmi or other network using in it,it read from the local db file and all the operations are in the local VM.
hope helpful
Nick
shan chen
Ranch Hand

Joined: Apr 09, 2003
Posts: 70

Originally posted by Frank Sun:
So, Could you show me a code snippet how to start up the rmiregistry?

java.rmi.registry.LocateRegistry.createRegistry(port);
DBImpl db= new DBImpl();
Naming.rebind("Database", db);
The default port is 1099. DBImpl is the class that implements interface Remote and DBMain.


And, quoted from instructions:'In non-network mode, must not involve the serialization of any objects when communicating between the GUI and database elements.'
what that mean?

In non-network mode, the code cannot use socket/RMI. The database file is in the same machine and the client just read the db file directly.
shan
shan chen
Ranch Hand

Joined: Apr 09, 2003
Posts: 70

Originally posted by Nick Lee
I think,I will write a flag to mark if a room has been ordered,right? so after click order button,I think I'll write the customer id into the db file and set the ordered flag for that room,that's all.

Hi, Nick,
A flag maybe is not needed. The owner ID itself is a flag. If the owner ID is blank, the record is not booked. If owner ID is not blank, the record is booked.
henry williams
Greenhorn

Joined: May 01, 2013
Posts: 1
Online booking system that can be used on any website offering hotel recommended services with real time availability.
K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2373
    
    7

Hello there,

You guys are getting there one way or another. Some of the key questions are actually answered in the SCJD FAQ. Some suggestions by people who already passed is in the Wall of Fame. Too help you understand a bit better, in random order:
1) The instructions should have a section like "Data file format" telling you the schema of the data file

2) The assignment is split into 3 main parts: 1) server (RMI or Sockets), 2) client (GUI/Swing) and 3) locking (for the server)

3) The app can be run in 2 modes: local and network. The local version is non-server (GUI talks directly to the DB file). The network version uses the server to interact with the file, needs to support multiple users hence locking

4) The record number is simply the data row number

5) If a room is booked, the owner field is filled in else it's available

6) Each record is really a bean say Room - parsing each row into its correct content (the Data class create(), update(), find() methods take an array) so somewhere you will need to convert an array to a Room and vice versa

7) For the RMI server, you shouldn't need to explicitly create stubs

8) To start your app, you will need to get the file location of the db (local and network), server port (eg 1099 for RMI for server only)

9) About design patterns, don't worry too much identify exactly what patterns you are applying (good to know though), but keep in mind delegation from server (remote) to local implementation of the Data class

10) For locking try to use the java.util.concurent package stuff if you can rather than writing your own version of some collection storing what is created/deleted/updated. Write test code for locking simulating many threads creating/updating/deleting rooms. Check out my good friend's post about testing Data class here and about testing business service here

11) document everything in your choices.txt file (architecture, search algorithm, locking mechanism, why one way is better than another etc)

12) I believe only the book and search functions are must on the GUI, but the other methods in the Data still need to be implemented even though you may not use them in the GUI.

13) oh keep the design and implementation logic simple


Good luck

K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5
 
Consider Paul's rocket mass heater.
 
subject: NX:Hotel-room booking system