Hi Mark,Peter and other guys:
I read the instruction again,and I found my assignment are not match the requirement at two points:
In Sun instrution:
The lock method should block until the requested lock can be applied
In my assignment:
public syrnchonized lock(int recNum,Object clientId){
....
if (the record was locked by other cliend)[
wait();
}
}
When the record that you want to lock was locked by other client,you will go to the waiting pool and give up the objec lock of lock() mehtod,so other cliend can access the mehod. The lock() method was not block,would I will lost the point?
To connect with your server,you should create a client program.This implementation should include a class that implements the same pulbic methods as the Data class,although it will need different constructors to allow it to support the network configuration.
On my client side,I define a LocalModel class implements the DataAccess interface,which contains the all public methods of Data class,but this class is only used for local database,donot need different constructors to support network.For the remote object,I get a reference of remote object and invoke the remote methods through the reference,I also donot need the network configuration.
Do I need to change my design?