shan chen

Ranch Hand
+ Follow
since Apr 09, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by shan chen

Hi, Maksim,
Sorry that I have misunderstood your question. In my application, method update in Data.java does not check the parameter. My reason is: only the owner_id field is changed when method update is called to book a room (my JTable is not editable). As the owner id is guarrented to be an 8-digit number with the help of PlainDocument, method update does not have to check it again.
It is good to check data in method update, while in my personal opinion, I prefer to validate data on client side if possible.
Regards.
shan
21 years ago
Hi, Andrew,
You gave me many help too. Thanks a lot. Good luck to your test result!

Hi, Maksim,

have you data validation (such as owner id must be 8 digit number) in the methods updateRecord(...) and createRecord(...)?


Yes, I validated owner id to be an 8-digit number BEFORE it is passed as a parameter to any methods. I used WholeNumberField.java which extends JTextField to input owner id when booking a room. WholeNumberField uses PlainDocument to ensure the input is an 8-digit number.
Following are two threads about this topic:
https://coderanch.com/t/241875/java-programmer-SCJP/certification/set-maximum-input-length-JTextField
https://coderanch.com/t/183397/java-developer-SCJD/certification/NX-maximum-input-length-JTextField

Hope these are helpful.
shan
21 years ago
Hi, Grorge,

Could you please share your desing pattern here?


I would like to share my experience. In choices.txt, I indicated that I used three design patterns:
1. MVC
The pirpose is to separate the data display from the actual data representation. The view is implemented by the main window in ClientApplication.java, the controller is implemented by GUIController.java, the data model is implemented by String array, and the data access is implemented by DBMain.
The ClientApplication has a reference to GUIController, and GUIController has a reference to DBMain. Briefly, the structure is :
main window --> controller --> data model

2. Adapter
Adapter pattern is used to handle the problem that DBMain can not be bounded to the RMI registry.(There are many disscussions about this issue and my solution is just one of them).
I used an adapter RemoteDBAdapter to wrap DBMain. RemoteDBAdapter implementes RemoteDBMain. RemoteDBMain extends Remote. RemoteDBMain has all methods defined in DBMain , except each method throws RemoteException. In this way, RemoteDBAdapter can be bounded to RMI registry as the remote object.
At the client side, I used ClientDBAdapter as an adapter to wrap RemoteDBMain to DBMain. Thus, the data access class is always DBMain in both modes.
3. Factory
With the help of Adapter pattern, I defined method getDBAccess to create data access object of type DBMain for both network mode and non-network mode.
public static DBMain getDBAccess ( ) throws IOException {
if local mode:
return local data access;
if remote mode:
return remote data access;
}

Do you use conncetion factory and lock manager?


I used connection factory, as I explained in factory pattern.
No, I did not used lock manager.
Hope these are helpful.
shan
21 years ago
Hi, Billy Tsai,

which new assignment did you do?


My assignment is URLyBird, hotel room booking project.

do you see the SCJD result directly after you login to the certmanager site?


Yes.
shan
21 years ago
It took 4 weeks for me to get the result. I sent email to ask them after 2 weeks and 4 weeks. Try to remind them when necessary.
shan
I just get test result. I took the new version assignment, but the grade was given as the old version. Thanks to all the helps I got from this forum! Follwoing is the detailed comments:

This report shows the total points that could have been awarded in each section and the actual number of points you were awarded. This is provided to give you per-section feedback on your strengths. The maximum possible number of points is 155; the minimum to pass is 124. Section Summary Report: General Considerations: Maximum=58 Deductions=0 Actual=58 Documentation: Maximum=20 Deductions=0 Actual=20 GUI: Maximum=24 Deductions=0 Actual=24 Server: Maximum=53 Deductions=0 Actual=53 Total: Maximum=155 Deductions=0 Certification Score=155

shan
21 years ago
Thanks. The TEST KING material is very helpful to me.
shan
21 years ago
I just passed 1z0-007 with 96.5%.
Following is the link for online test. You need to create an account.
http://oracle.prometric.com/
21 years ago
Hi, Chitra,
Would you please be a little bit specific about the book name you mentioned? biju thomas has servel books with similar topic. Following is a list of his books. (Clearly he is smart at making money.)
1.
OCA/OCP: Oracle9i DBA Fundamentals I Study Guide
2.
Ocp: Oracle8I Dba SQL and Pl/SQL Study Guide: Exam 1Z0-001
3.
OCA/OCP: Introduction to Oracle9i SQL Study Guide
thanks.
shan
21 years ago
Hi,
I am new to this Oracle group. I wish to know what is the difference between '1Z0-001 Introduction to Oracle: SQL and PL/SQL' and
'1Z0-007 Introduction to Oracle9i: SQL'? From their content check lists, 007 covers less than 001, though 007 is new.
So which exam will you recommend?
Thanks.
shan
21 years ago
Thanks, Andrew. Now I know the differences. My implementation is the first version. It is nice to see how Factory Pattern implemented with RMI.
shan
Hi, Michael,
Thanks for your reply. Now I understand your design. My implementation is different, so I did not realize this at first, sorry. Can I make some comments? I deem it a chance for me to learn something.

Just think about the threading problems and chaos you would have if every client interacted with the same remote object.


I think it is the merit of RMI. RMI handles multi-threading issues. That is one of the reasons I chose RMI.

That remote object should have a method like getConnection() which will return a unique DataAccess (or whatever you call it) object to the calling client.


According to RMI policy, the DataAccess object passed to client is pass-by-value. In the case that the client want to call 'book', will the client call DataAccess directly or through the remote object?
Thanks.
Shan
Hi,
I am a question about RMI remote object here. How many remote objects will be generated for multiple clients?
Michael said its own RMI object. Do you mean one remote object for each client?
Padmaja said I have one "non-static" Arraylist that holds all record numbers locked by the current thread.. Where is the Arraylist? In the remote object?
Andrew said The RMI interface keeps track of which records were locked by this connection
Do you also imply one remote object for each client?
My understanding is there is only one remote object on the server side. Remote object is
pass-by-reference to the client. Stud is sent back and forth.
I have done the following test: add a static variable to the remote object class, the static variable increses by one in the constructor. When I run the program, the static variable keeps as one even though multiple clients have connected to the server.

shan
Hi, Michael,
Thanks for your reply. I just checked my instruction and did not find the requirement you mentioned: "An unlock request should be ignored of a requesting client does not own the lock." My assignment is new version hotel room booking. I hope someone else with the same assignment could check their instructions to help me to verify it. If such requirement exists, we DO neeed client ID.
For the next two questions, I will write in choices.txt that it is assumed those situation will not happen.