This week's giveaway is in the Programmer Certification (OCPJP) forum.
We're giving away four copies of Java Mock Exams (software) and have David Mayer on-line!
See this thread for details.
Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Data Client Implimentation Requirements!

 
Vikas Sood
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,
My specs for Dataclient implementation say:
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, although it will need different constructors to allow it to support the network configuration.

But in my implementation i have made use of a Factory class, which as per the parameter passed by the client,connects to database locally or through the network. Will i be ok by explaining my implementation in design doc, or should i cahnge my DataClient implementaion and include two constructors in DataClient for two modes instead.
Kindly comment am confused.
VikasSood
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Posts: 12056
232
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Vikas
I dont see any problem with what you have done.
I think the important part of the instructions are that the public methods defined in the Data class are accessible via either networked or local mode. It sounds like you have done this.
I read the instruction about the constructors to mean that we do not have to implement the same sorts of constructors over the network - instead we may use any constructor that we deem to be appropriate.
For example, the Data class has a constructor which allows you to create a brand new database with no records. You would probably not want to have such a constructor available to every networked client.
Similar to you, I had a factory to connect in either local or networked mode. The client code did not even see the constructors for local or remote mode - this was hidden within the classes used by the factory. All the client saw was that it used a method in the factory to get an instance of a connection to the database which provided all the methods of the Data class. I did not loose any points on the GUI side, so I guess this must have been OK
Regards, Andrew
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!