• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help! Advise on the Design approach.

 
Raju, Gentle
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Gurus,
I am planning to go ahead with the following design approach. Please provide your advises.
I will have interface DatabaseIF with the all public methods in data class. I will have Remoteserver which will implement DatabaseIf and extend UnicastRemoteObject. I will also have LocalServer Class which will implement DatabaseIF. RemoteServer and LocalServers will contain a member variable of Data type called RemoteData and LocalData. This is done basically to not to expose the Data classe directly. I will be accessing all the methods in RemoteData or LocalData through RemoteServer and LocalServer. From the client side I will be checking for the mode from the user and create that object as shown below.
if ( modeType == "Remote");
{
database = RemoteServer; (Create Remote object here )
}
if ( mode type == "Local)
{
database = Local; (Create Local object here )
}
Hereafter All I will do is: database.methodName();
With this approach I am facing a problem. Some of the methods in Data which are private can not be called from RemoteServer or Local Server class. The only solution I see is to modify Data class by adding additional public methods to call these private methods. Is this ok ? Is my design ok ?
Please post your comments and they are important to me.
Thanks
Raju
 
Marco Barenkamp
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Generally, you may modify the method signatures as long you can
explain why you did it and why it makes sense.
But in my opinion, there is no need to change the private methods.
Clients should only use the public methods because everything can
be done with these methods.


------------------
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic