Forums Register Login

Required Interface and RMI

+Pie Number of slices to send: Send
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?
+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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
Everybody! Do the Funky Monkey! Like this tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 727 times.
Similar Threads
recNo in Bodgitt and Scarper
IOException in db find method
URLyBird-1.2.2 assignment, what should inside the assignment jar?
Should lock methods be callable by the client
URLyBird interface?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 05:28:37.