Hi Everyone,
I have a question about implementing the public methods of the Data class in the
FBN assignment.
There are 2 requirements(as in the instructions):
===================================================================================
1. The remote client code that you write must provide all the public methods of
the suncertify.db.Data class.
2. To connect with your server,
you should create a client program. This implementation
should include a class that implements the same public methods as the suncertify.db.Data class
===================================================================================
After reading the above 2 req., I have devised the following sol. :
a. DataInterface - An Interface which has has all public methods of the Data class.
b. 2 classes which implement this interface :
i. RMIServer - The actual Server which will implements the DataInterface. The imlementation
of this method will actually call the methods in the Data class.
ii. LocalClient - Used on the client side, implements the DataInterface . This will have the
same method signature as the public methods in the Data Class. Each method will call either
the RMI server or will access the local Database methods depending on the mode.
For e.g. this class will have a method called public DataInfo[] criteriaFind(
String criteria).
If it is in a non networked mode, this method would call the criteriaFind method of the
Data class. If it is in a networking mode, it would call the method called criteriaFind
in the RMI Server,which in turn would call the criteriaFind method in the Data class.
Does this solution look O.K ? Am I missing something here ??
Any help will be appreciated.
Thanks in advance
Gokul