Data Interface confusion
posted 22 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
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
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
posted 22 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Hi Gokul
Welcome to JavaRanch.
This is the same way I did it.
Regards, Andrew
Welcome to JavaRanch.
This is the same way I did it.
Regards, Andrew
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Gokul Krishnan
Greenhorn
Posts: 3
posted 22 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Thanks for the quick reply.
Just wanted a confirmation to see if I was on the right track.
Gokul
Just wanted a confirmation to see if I was on the right track.
Gokul
| What do you have in that there bucket? It wouldn't be a tiny ad by any chance ... The new gardening playing cards kickstarter is now live! https://www.kickstarter.com/projects/paulwheaton/garden-cards |











