Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Help! Advise on the Design approach.

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.
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.

    Bookmark Topic Watch Topic
  • New Topic