aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes looking for SCJD checklist!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "looking for SCJD checklist!!" Watch "looking for SCJD checklist!!" New topic
Author

looking for SCJD checklist!!

jyothi sunke
Ranch Hand

Joined: Sep 11, 2002
Posts: 65
Hi all,
I will be glad if any one give me an idea about things we should take care before uploading an assignment. In index file, sun provided deliverables section. In addition to that, are there any things to verify from programmer point of view??
Especially how test in the network mode to make sure that my application is working correct!! I read some posts here which are about, ex: 150 clients can concurrently connect to the database and can book the seats, and they were talking about performance also!!(here I understand that they gave the for loop, to connect all clients one by one, at a time)..Is this right???
I didn't understand about this..What I am doing is, each client is running in separate Dos prompt. For me to test my application for 20 clients I have to use 20 Dos prompts.. Is my procedure correct??
Please give me clear idea about this.
Thank you!!!


jyothi
Mag Hoehme
Ranch Hand

Joined: Apr 07, 2002
Posts: 194
Hi Jyothi,
check your instructions very carefully! That's the best piece of advice I can give to you.
Check the posts in this forum. I found that many posts were dealing with issues I had taken for granted (but in fact misunderstood them).
Regarding the testing: I used JUnit (freely available at http://www.junit.org) to simulate multiple users. I used it to start any number of threads accessing my non-GUI classes at the same time. However, my JVM (JDK 1.4 on W2K) did not accept more than 17 concurrent clients. Finally, debugging more than one thread - using JUnit or not - is a tedious task! :roll:
Hope this helps.
[ November 04, 2002: Message edited by: Mag Hoehme ]

Mag
Juan Katabasis
Ranch Hand

Joined: Jun 20, 2001
Posts: 46
hello Jyothi
the way you are testing the server doesn�t seem very appropiate, because you can't simulate the situation where a client asks (and locks) a record, and other client asks the same record and waits for unlock.
the best thing to do is to create (as example) 50 threads (one for each client to simulate), and make each one order 20 times, may be with some forced delay (sleep). that's probably the closer simulation to reality.
[ November 04, 2002: Message edited by: Jaun Katabasis ]

Regards<br />J.
jyothi sunke
Ranch Hand

Joined: Sep 11, 2002
Posts: 65
Hello all
Mag & Jaun,Thank u very much for ur response. I have some questions about how to test the application.. Please clarify them. Here r the questions..
1. Do we need to maintain two copies of db.db file, one for the local mode and another for the network mode?? If application connects to local mode it updates the local db.db file, other wise it updates the server side db.db file. I just want to know how u guys are following??
2. I am not yet created the jar files. Here is how I am executing the application..please let me know if my procedure is wrong..
I am running the application on my desktop.
i.e, both my server and client classes are in the same system.
server side classes are in C:\fbn\-- directory
client side classes are in C:\jyothi\ -- directory
location of db.db file is c:\fbn\-- directory
Staring the server:
C:\fbn> start rmiregistry
C:\fbn> java
-Djava.security.policy = mysecurity.policy suncertify.server.DataServerInterfaceImpl
-fc:\fbn\db.db
Starting client appication:
C:\jyothi> java -Djava.security.policy = mysecurity.policy -Djava.rmi.server.codebase =file:///c:\fbn\ suncertify.client.ModeSelectionGUI
ModeSelectionGUI enables the user to select either localmode or network mode. For nework mode user has to enter DNS Server name and port number.
I am giving DNS Server Name as localhost. Application is running fine. But comments are welcome...
Thanks in advance...
Mag Hoehme
Ranch Hand

Joined: Apr 07, 2002
Posts: 194
Hi Jyothi,
Q1. My assignment worked fine with a single db.db file, which I put into a separate folder (but maybe that's why I got two points off for General Considerations - I don't know). However, for your upload, keep an unaltered spare copy.
Q2. What you do looks fine to me.
However, I choose a different approach: I created two jar files - server.jar, and client.jar. The classpath and the main class were specified in the manifest file, so that it was easy to start the server and the client with a simple command line , e.g. $ java -jar client.jar (for local mode), $ java -jar client //whatever-host, $java -jar server /fbn/db.db. I found that this was the easiest and most robust way to do it, and it was simple to describe in the readme.txt.
Hope this helps.
[ November 05, 2002: Message edited by: Mag Hoehme ]
Juan Katabasis
Ranch Hand

Joined: Jun 20, 2001
Posts: 46
Hi again
basicly hi have same options than Mag. two independent jar files, each of them need the db.db in the directory they are located, so if they both are placed in the same directory they will use the same db.db ( i describe this in the readme document)
also i prefer jar files with defined main classes. i just start the server with
> java -jar server.jar
it launches a local Registry and the server application. and i launch the client by
> java -jar client.jar for local mode or
> java -jar client.jar <host> <port> for remote mode
that's all i need to laucn the applications
[ November 05, 2002: Message edited by: Jaun Katabasis ]
jyothi sunke
Ranch Hand

Joined: Sep 11, 2002
Posts: 65
Hello,
Mag & Jaun Thanks once again for ur responses. yeah I am working on building jar files. I have one more question..
In the requirements it is given that, list some of the major advantages and disadvantages of each of ur choices.. I am comfortable with RMI and I don't know much about sockets..Ofcourse I read sun tutorial about both, but not able to figure out advantages & disadvantages of both. Can anyone give me an url where I can find differences between these two??
And one more thing is, I used only Adapter pattern in my design. For GUI I don't know whether I used MVC pattern or not, but it is working fine. Especially when accessing the LocalClient and RemoteClient classes do we need to use Factory pattern ??
Please give me suggestions..
Thanks!!
jyothi sunke
Ranch Hand

Joined: Sep 11, 2002
Posts: 65
Hi,
Do we need to maintain the directory hierarchy in jar files?? I think we have to. Is that right??
thanks..
Mag Hoehme
Ranch Hand

Joined: Apr 07, 2002
Posts: 194
Hi Jyothi,
as per instructions, we are not required to stick to the directories provided with the assignment. I had three directories, one for the server, another for the GUI, and a third one for non-GUI client stuff.
jyothi sunke
Ranch Hand

Joined: Sep 11, 2002
Posts: 65
Hi Mag,
I didn't understand what u said. Can u tell me in detail fashion? Do u mean that we need not maintain diretory hierarchy in the jar files? or r u talking about developing the application??
I have one more question, I devided the classes in four packages(db,mediator,client,server). both server and client classes makes use of both db and mediator classes. So do we need to put those classes(classes in db & mediator packages) in both client and server jar files? or only class files of client or server(I mean classes in these two packages) is enough in those jar files?? I am not getting the clear idea..
Please help me!!!
Please go through my previous post also(about RMI Vs Socket advantages/disadvantage & design Patterns)..
Thanks a lot in advance!!
Mag Hoehme
Ranch Hand

Joined: Apr 07, 2002
Posts: 194
Hi Jyothi,
I'm sorry but it seems that I do not understand your question properly. Could you please clarify?
My packaging solution was rather easy: The server.jar had the server-side classes, and the client.jar had the client-side classes (that is, GUI and helper classes). But the client required server.jar to be in the classpath.
Some people say that it is necessary to have the stubs in the classpath of the client. This is necessary if you don't want to do stub downloading. The advantage of having the stubs in the classpath is that you don't need to deal with all the security stuff. The alternative is to implement a security manager and download the stubs from the server. (Remember: A Java app is not allowed to accept classes from a stranger - that is, a possibly malicious machine, unless it is explicitely allowed to do so.)
Hope this helps.
jyothi sunke
Ranch Hand

Joined: Sep 11, 2002
Posts: 65
Thank you very much Mag. you provided me very useful information. I will work on that and I will approach you if I face any problems in deployment(I didn't build jar files yet)..
[ November 07, 2002: Message edited by: jyothi sunke ]
jyothi sunke
Ranch Hand

Joined: Sep 11, 2002
Posts: 65
Originally posted by Mag Hoehme:
Hi Jyothi,

My packaging solution was rather easy: The server.jar had the server-side classes, and the client.jar had the client-side classes (that is, GUI and helper classes). But the client required server.jar to be in the classpath.
Some people say that it is necessary to have the stubs in the classpath of the client. This is necessary if you don't want to do stub downloading. The advantage of having the stubs in the classpath is that you don't need to deal with all the security stuff. The alternative is to implement a security manager and download the stubs from the server. (Remember: A Java app is not allowed to accept classes from a stranger - that is, a possibly malicious machine, unless it is explicitely allowed to do so.)
Hope this helps.

In my application I am not downloading stubs from server.jar. This can be achieved using : -Djava.rmi.server.codebase property right!!!
How to set the stubs in classpath of client?? I am not setting any class path for client. In my system classpath set to current directory. and I am creating client.jar with stub classes in suncertify.server directory and it is working
fine.. Is my procedure correct???
Thanks in advance..
Mag Hoehme
Ranch Hand

Joined: Apr 07, 2002
Posts: 194
Hi Jyothi,
I used no command-line argument. The only required arguments were the database location (local) or the remote machine (remote). I think this saved me a lot of problems.
Hope this helps.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: looking for SCJD checklist!!