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 Questions regarding to the project development 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 "Questions regarding to the project development" Watch "Questions regarding to the project development" New topic
Author

Questions regarding to the project development

Helen Ma
Ranch Hand

Joined: Nov 01, 2011
Posts: 451
Hi, before I work on the assignment, I would like to make sure the following steps for the developments are true and recommended :
1. Develop the DB layer (just like sampleproject.db) to finish the locking mechanism first. Develop the standalone application.

2. Run Roberto's test for Data class. His test is to test the DB layer operations in multiple threads environment. If the test passes, that means it will work for the RMI environment. Roberto's test is to simulate multiple clients requesting for data in RMI.
Is it true?

3. Develop RMI or socket layer. Do I need to write specific tests for the operation in RMI environment even though test pass in step 2?

4. Enhance or develop the GUI layer at the end.

So, basically, if test for the locking mechanism passes in step 2, that means things will work in step 3 and 4.Is it true?


Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5201
    
  12

I followed a complete other approach. The GUI was the final and last part I developed. First I developed Data class, then service implementation (which was exposed by rmi) and finally the GUI.

For both Data class and service implementations I wrote tests (using JUnit) to make sure everything worked as expected. And also wrote some tests (and used Roberto's Data class test) to make sure classes behave flawless in multi-threaded environment. I didn't started with developing service implementation until Data class was completely finished.

So, basically, if test for the locking mechanism passes in step 2, that means things will work in step 3 and 4.Is it true?

That's only true if you use the API (Data class) correctly. So if you never unlock a record in your rmi/socket layer then you'll have a problem.


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
Helen Ma
Ranch Hand

Joined: Nov 01, 2011
Posts: 451
So, do I need to create a multiple thread program maybe called it TestRMIApp.java:
create multiple threads that start the RMI server, and then start two clients and then clients invoke remote methods and test the result?

It seems to me that running Roberto's Data class test is not good enough.
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5201
    
  12

I don't see why you would start multiple RMI servers 1 RMI server with a bunch of clients will be more than enough.
Helen Ma
Ranch Hand

Joined: Nov 01, 2011
Posts: 451
Maybe, my wording was confusing in the previous post.

I am thinking of creating a multiple thread program that starts multiple clients. For the server side, I can start it manually.
In this multiple thread program, the threads start clients and clients can request remotely invoke methods on the running server.

I am not sure if that is feasible in JUnit test framework. If not, I can develop a test just like Roberto's Data class test.
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5201
    
  12

Helen Ma wrote:I am not sure if that is feasible in JUnit test framework. If not, I can develop a test just like Roberto's Data class test.

For the multi-threaded approach I also created similar small programs like Roberto's Data class test (using org.junit.Assert to evaluate the results)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Questions regarding to the project development