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

About "Data.java" in local and network implementation

 
Davidd Smith
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
The instructions says "Your data access class must be called "Data.java", must be in a package called "suncertify.db", and must implement the following interface: DBAccess", but we must have two kinds of implements: local and network. Should the two class be all called "Data.java" and in "suncertify.db" or must they be in the same class? What should I do?
 
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 Davidd
Welcome to JavaRanch.
I dont think there is anything in your instructions that requires your client code to directly use the Data class or the DBAccess interface.
You can write your Data class which will provide the basic database access features (create, read, update, delete), then build on top of that for what you need for the rest of your application. So if you need networked access to the database, you could write your networked code so that it uses the Data class. Your networked code does not have to be a Data class.
This allows a cleaner division of responsibilities. Data class is only concerned with getting data into and out of the database - it is not concerned with whether a client is coming in over RMI or Sockets or ???. Likewise your networked code is only concerned with networking issues - it is not concerned with how to physically read the data out of the file.
Regards, Andrew
 
Davidd Smith
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Andrew,
Thank you very much, I understand.
Davidd
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic