Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Data Interface confusion

 
Gokul Krishnan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12014
220
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Gokul
Welcome to JavaRanch.
This is the same way I did it.
Regards, Andrew
 
Gokul Krishnan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the quick reply.
Just wanted a confirmation to see if I was on the right track.
Gokul
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic