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 Required Interface and RMI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Required Interface and RMI" Watch "Required Interface and RMI" New topic
Author

Required Interface and RMI

Dirk Band
Greenhorn

Joined: Jun 16, 2003
Posts: 8
Hello,
I have got a question concerning the required interface.
My assignment says:
"Server
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: 11277
    
  59

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
Greenhorn

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.
Regards,
Dirk
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Required Interface and RMI
 
Similar Threads
recNo in Bodgitt and Scarper
Should lock methods be callable by the client
URLyBird-1.2.2 assignment, what should inside the assignment jar?
IOException in db find method
URLyBird interface?