• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

B&S: Data access class

 
Tobias Lund-Melcher
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my assignment it is statet; "Your data access class must be called "Data.java"...". Does this mean that I only may access the data file from this class?

I would like to create a class wich accesses the data file to retrieve the metadata describing the data file. This would allow me to exchange the reading of metadata with another class if the metadata should change leaving the Data class unchanged.

Thanks for any help.

-Tobias
 
Alex Belisle Turcot
Ranch Hand
Posts: 516
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Tobias Lund-Melcher:
In my assignment it is statet; "Your data access class must be called "Data.java"...". Does this mean that I only may access the data file from this class?

I would like to create a class wich accesses the data file to retrieve the metadata describing the data file. This would allow me to exchange the reading of metadata with another class if the metadata should change leaving the Data class unchanged.

Thanks for any help.

-Tobias


Hi,

it means that the class implementing the provided interface must be called "Data". This does not prevent Data.java from using other classes to fulfills its task.

However, try not to do too much. What you are about to do, is it really a requirement/necessary ?

Regards,
Alex
 
Tobias Lund-Melcher
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply Alex,

no it is not necessary, its just that the Data class is becoming a bit large and I would like to delegate some of the things done in the Data class to other classes and hopefully thereby increasing the readability.

BR
-Tobias
 
Jethro Borsje
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My Data class is actually delegating the actual reading to a class called DBFileAccess which uses a RAF to read the file. If we would later chose to use a SQL database an SQLDBAccess class could be implemented which could then be called by the Data class. This makes my Data class independent of the actual DB implementation. I think this is a nice design and it keeps the Data class from becoming to large.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic