• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Data Interface confusion

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the quick reply.
Just wanted a confirmation to see if I was on the right track.
Gokul
 
And when my army is complete, I will rule the world! But, for now, I'm going to be happy with this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic