• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Non-Networked Mode

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 288
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.

 
Martin O'Hara
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 288
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 288
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic