jQuery in Action, 3rd edition
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Required Interface and RMI 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 "Required Interface and RMI" Watch "Required Interface and RMI" New topic

Required Interface and RMI

Dirk Band

Joined: Jun 16, 2003
Posts: 8
I have got a question concerning the required interface.
My assignment says:
Required Interface
Your data access class must be called "Data.java", must be in a package called "suncertify.db", and must implement the following interface:
package suncertify.db;
public interface DBAccess
// Reads a record from the file. Returns an array where each
// element is a record value.
public String [] readRecord(long recNo)
throws RecordNotFoundException;
// Modifies the fields of a record. The new value for field n
// appears in data[n]. Throws SecurityException
// if the record is locked with a cookie other than lockCookie.
public void updateRecord(long recNo, String[] data, long lockCookie)
throws RecordNotFoundException, SecurityException;
this is clear to me when it comes to local access.
The Question is: Do I have to implement this interface into my RMI DataImpl class as well? If yes. It is not possible to implement this interface and throw any broader exceptions, as required when using RMI.
When using RMI each method must throw and RemoteException.
Is it completely wrong to use RMI in this case?
My main concern is the "must" in the requirement of th assignment.
Any answers?
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11776

Hi Dirk
I would only take that "must" as applying to the data access class (Data.java) not to your network interface.
I have noted that a lot of candidates in this forum are only providing business methods in their network interface (bookRoom() or bookContractor()) rather than providing any of the methods from the data access class's interface.
Regards, Andrew

The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Dirk Band

Joined: Jun 16, 2003
Posts: 8
Hi Andrew,
If I have two interface one for network one for local. This causes probably more redundant work at the client side. Means data access via local mode and data access via network mode. Two simular interfaces would be nice.
I agree. Here's the link: http://aspose.com/file-tools
subject: Required Interface and RMI
It's not a secret anymore!