Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!

jian zheng

Greenhorn
+ Follow
since Jan 07, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by jian zheng

Hi,
I just want to find out the possiblity of part time for it,pls mail to viaquobox@msn.com if you think it is possible.
Thx & good luck!

Jian
SCJD
15 years ago
Thank you Andrew.I think I have to find it out by myself.I have not enough design experience.And I believe I'll know suddenly someday,it happened a lot.Experience will be more when time going,haha
Thanks again!
Regards
Jian
16 years ago
Thanks Mark ,and will you excese me that I post database lock up to now? I forgot it and Andrew reminded me.
Hi Andrew,nice meeting you again,you gave me a big help Do you remember?
Yes,you are right.I lock database when do book.I check whether the record has already been locked before I lock this record,lock it if it's free or wait() if it's been locked by others,and when others notifyAll(),check again,lock,book,unlock,notifyAll() if check pass and keep waiting if not.

I noticed that my score is not good at "General Con" part, is that mean there is problem in my design or anything else?I just want to know what I can do to make things better?Any ideas?
Thank you!
Best Regards
Jian
16 years ago
Hi Mark,
Here is my score details:
Section Summary: Section Max Actual Points Points General Con: 100 77 Documentation: 70 68 OOD: 30 30 GUI: 40 40 Locking: 80 80 Data Store: 40 40 Network Server: 40 40 Total: 400 375
As a matter of fact I don't know English very well,so would you please tell me what's the meaning of "Section Max Actual Points Points General Con" mentioned upon?
I think my lock design is same with most of others.And here it is:
The locking mechanism is used in multi-client network mode in fact.When user do book a record through RMI the client invoke the book function which is synchronized.What the book function do is lock-update-unlock,and wait if record has already been locked by others.Lock and unlock function are also synchronized.What lock do is to put record into an vector and what unlock do is to remove record from vector.This vector stays in Data class as a member of Data,it's single because we got Data from DataManager in singleton pattern.
This is what I described my lock design in my choice document.
Hope it helpful!
Best Regards!
Jian
16 years ago
Hi guys,I'm so happy that I passed SCJD.I'm so excited and do not know what to say.Thank you!All of you.I'v made a serious mistake in my design,and it's you who help me to understand what the Sun really want.I can't pass the test without your help.Thank you!
16 years ago
Hi all,
The general way to work in Shanghai is to find a company to employ you first,and this company will apply foreigner employee's card for you.You can start your new career when you got the card.You can regist and search on web site mentioned upon(51job)
Hope this helpful!
Best Regards!
Jian
16 years ago
Hi all,
I don't know the official job seek web site in China,but I usually visit "http://www.51job.com"; and it has the english version "http://www.51job.com/default-e.php?from=inner"; maybe you can try this.
I'm sorry I don't know the details about the apply procedure.Many Chinese IT guys go to USA,Canada,Australia,Singapor...but few foreign IT guys come to China,so I'm more familiar with how to go abroad.The most result that few people would like to work in China may be the language here is not English .I'll search this information(I mean apply procedure) in my spare time and post here later.
I think the best way is the company you are serving now has branch in China,and you can apply for a position in the branch of China.This way,you can take the same or higher salary but enjoy the colorful but not expensive life in China for a long time .Any ideas?
Best Regards!
Jian
16 years ago
Hi all
I saw somebody ask how about the IT in China now.So,are u interested in it?
Let me introduce for u,I think it's a good example myself.
I'm a java programmer with three years' experience,SCJP and maybe SCJD next month(hope so ),my major job is to develop e-business for Shanghai bus group,my salary is about 6k RMB per month.I'v never go abord,foreigner's salary is higher than Chinese here,and salary level is different in each city,there is more IT chance in Beijing.Now I settled here and work from 9:00AM to 6:00PM everyday.Holiday is few,not like Europe.You can find a good house if you pay 1k RMB per month,food is not expensive here,I pay 15RMB on food everyday,and the taste is good,it's Chinese food .Trafic is not very good if you work at the center of the city,but Pudong in Shanghai is good.Trafic fee is not expensive,I pay 10RMB on traffic fee everyday because I live so far from the center of the city and I work at the center of the city .By the way the salary 6kRMB includes tax,it's more than 5k when corp give u salary,and 1USD equals 8.xRMB.That's all.Welcome to China
16 years ago
Thx all!
You give me confidence!
Hi all,
I'm ready to submit my exam and review the requirement.I got confused with the following:
"Network Approaches
Your choice of RMI or serialized objects will not affect your grade, but no other approach is acceptable. In either case, the program must allow the user to specify the location of the database, "and it must also accept an indication that a local database is to be used, in which case, the networking must be bypassed entirely. No authentication is required for database access. "
I use a FileChooser to allow user specify the db file's location when starting server, but user can still locate a db file not local through Network Neighbour, is it ok?I mean on windows platform.
Thanks
Thank you George,I would still be in my wrong way about package instructure without your help.Thank you!
Best regards!
Jian
Hi all,
I'm so excited ,I've solved this problem and know why to do so .
Here is what I've done:
I start rmiregistry in my code replace of starting it in command-line.
I just add "LocateRegistry.createRegistry(1099);" before binding the remote object.This way,of course rmiregistry will know where to get XXX_Stub now without CLASSPATH.
And what the test officer will do is to run "java -jar runme.jar server",he need not to start rmiregistry in command line even.
My mind is :
If I start rmiregistry in command line,rmiregistry do not know where to get XXX_Stub without CLASSPATH and codebase,but it'll find the XXX_stub when starting rmi is part of the whole application,it'll will find class in the jar.Is it right?
It's just my mind,and I want to hear some different voice
Best Regards!
Jian
Hi all,
Thank you for your replies.As what you suggest I put all files into runme.jar(just one jar,I'm sorry I put files in two jars before ,it's a mistake),but still I need to set CLASSPATH=XXX\runme.jar to start the server before start rmiregistry,it looks like rmiregistry don't know where is XXX_Stub if I don't set CLASSPATH beforehand.But client is fine without CLASSPATH setting running in network mode,although it use XXX_Stub too.I test client in another machine without CLASSPATH.I really don't know what's the difference between my program with yours.
And I found server can't be start without CLASSPATH even if the code is not in jar.
Thks George,JunKao,Dixon and Max
Best Reards
Jian
[ February 08, 2004: Message edited by: jian zheng ]
[ February 08, 2004: Message edited by: jian zheng ]
Hi George,
Thank you .I think you are right.I'll try to run the program without setting CLASSPATH.But I'm sure that I've put the "XXXX_stub.class" in right package and it's already been in the jar,here is my package structure:
-------------
suncertify.db
-------------
Data.class
RemoteData.class
RemoteDataImpl.class
RemoteDataImpl_Stub.class
xxxException.class
...
-------------
suncertify.srv
-------------
Server.class
-------------
suncertify.ui
-------------
XXXXXXXXX.class
XXXXX.class
.....
I bind RemoteDataImpl.class in Server.class,server.jar includes suncertify.db and sunertify.srv,and the main class is Server.class,is it ok?
The result is "XXXX_Stub not found" if I've not set CLASSPATH before I start rmiregistry,but "java -jar runme.jar server" is ok without "XXX_Stub not found".I got confused because client use "XXX_Stub.class" when it runs in server mode too.
I'll try like what you said,maybe I lost something,and I'll change the package structure if needed.
Thank you!George
Best Regards!
Jian
Hi all,
I test my baby these days , everything is ok before I put all files into jar,now when I run "java -jar server.jar" system tell me "XXXX_stub.class not found",I solve this problem with adding server.jar to CLASSPATH,but I don't know if it's leagle.Restrictions on RMI is different now,here it is
"Restrictions on RMI
To avoid unnecessary complexity in the marking environment certain restrictions are placed on solutions that use RMI. Specifically:

You must not require the use of an HTTP server.
You must not require the installation of a security manager.
You must provide all classes pre-installed so that no dynamic class downloading occurs.
You must use RMI over JRMP (do not use IIOP)"
I don't know what's the meaning of "You must provide all classes pre-installed so that no dynamic class downloading occurs" , may I require the test officer set the CLASSPATH as what I need before he run the server?
Thxs