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


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Non-Networked Mode" Watch "Non-Networked Mode" New topic
Author

Non-Networked Mode

Martin O'Hara
Greenhorn

Joined: Sep 25, 2006
Posts: 3
I have a question regarding the requirement listed below. In the SCJD instructions under the Non-Networked Mode section.

The program must be able to work in a non-networked mode. In this mode, the database and GUI must run in the same VM and must perform no networking, must not use loopback networking, and must not involve the serialization of any objects when communicating between the GUI and database elements.
The operating mode is selected using the single command line argument that is permitted. Architecturally, this mode must use the database and GUI from the networked form, but must not use the network server code at all.



I am working on the URLyBird 1.2.3 version of the assignment. Due to various reasons i was unable to work on it until recently. I a using version 1.5.0_08-b03 of Java.

I have finished (hopefully) the Model Layer an have sarter to design, test, implement my RMI solution.
I have chosen to use RMI.

Here is what my design looks like:

I have created a general interface called DBClientIF that has the same methods as the DBAccess IF provided by SUN, the only difference is that they are decorated with the
throws RemoteException
clause.



To use RMI I have a another IF called RemoteDBIF with a signature of



The actual RMI implementation is in a class called RemoteDBAapter


The above mentioned code should address the "newtork" mode of the assignment. The only thing I might add would be to expose the Application specific Exceptions that can be thrown by the model layer. (in DBClientIF)

Now for the
Local
or non-networked mode. To address the Local mode I created an implementation class called LocalDBAdapter that implements the DBClientIF.



Finally to the real question.
According to the assignment instructions
Architecturally, this mode must use the database and GUI from the networked form, but must not use the network server code at all.


Does my local design adhere to the requirments?
To recap I am using a common Interface for both networked and local modes. My DBClientIF decorates the methods with a
throws RemoteException
and my local implementation implements said interface. Is the DBClientIF considered network server code?

My feeling is that for code to be considered network it needs to extend and implement . Just because an interface says that it could throw a RemoteException, the implementation might never actually throw it?

Thoughts?
Mark Smyth
Ranch Hand

Joined: Feb 04, 2004
Posts: 288
Originally posted by Martin O'Hara:


My feeling is that for code to be considered network it needs to extend and implement . Just because an interface says that it could throw a RemoteException, the implementation might never actually throw it?

Thoughts?


Design looks just fine to me, I am doing something similar myself. What you could do if you want is to change the RemoteExceptions to IOExceptions in the local interface to make it look less "networky". As RemoteException is a subclass of IOException can still throw RemoteExceptions from your remote class.



SCJP<br />SCJD
Martin O'Hara
Greenhorn

Joined: Sep 25, 2006
Posts: 3
Thanks for the response. I did implement the change the you identfied and now I feel better about the class looking less "networky". Maybe it was just me being paranoid.

Who knew the "must" could be turned into something evil!!!
Mark Smyth
Ranch Hand

Joined: Feb 04, 2004
Posts: 288
Originally posted by Martin O'Hara:
Thanks for the response. I did implement the change the you identfied and now I feel better about the class looking less "networky". Maybe it was just me being paranoid.

Who knew the "must" could be turned into something evil!!!


"must" is the most evil word in the english language for people doing the SCJD
Mike Ngo
Ranch Hand

Joined: Oct 16, 2006
Posts: 89
I am working on URLyBird 1.2.2. Does anyone know if we are allowed to use design patterns? I want to use the business delegate pattern.
Mark Smyth
Ranch Hand

Joined: Feb 04, 2004
Posts: 288
Originally posted by Mike Ng:
I am working on URLyBird 1.2.2. Does anyone know if we are allowed to use design patterns? I want to use the business delegate pattern.


Yeah the use of patterns is perfectly acceptable for the SCJD.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Non-Networked Mode