• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What shall Data class really do?

 
mohammad abdellatif
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am currently working on SCJD assignment, I have some concerns regarding Data class which must implement interface DBMain.
In assignment document it is written
Your data access class must be called "Data.java", must be in a package called "suncertify.db", and must implement the following interface:

package suncertify.db;
public interface DBMain {


What does data access class means?
Does it means the only class from which to access DB file stream and perform locking and unlocking is Data.java OR I can have helper class used internally inside Data.java to do such things??

To be more clear:

I am planing to separate the behavior of locking records and accessing DB file bytes to two classes used internally by Data.java.
Can I do this or what??

Thanks for your concern
 
Matheus Mendes
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi mohammad !

Well it's all on your interpretation. You could do whatever you think is right. But you must try to do the best way and justify this decision. The most important isn't WHAT you did, but the WHY you did it.
 
mohammad abdellatif
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much for your response.

I was thinking in the same way you have just wrote, but I wanted to make sure if I really understood what was written in requirements.

After completing the assignment, I will make sure to put my grade on this topic as a record for others to see if what I was thinking is right.

Thanks again
 
Matheus Mendes
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry if I was too short on my post, I was entering in a meeting.

But that's the whole thing, you should think and try to get the best solution. An advice, when I designed my application I did separete the locking class and the database class. So I have a utility class that care about my locking mechanism and another class that implements the provided interface. But the class that implements the provided interface isn't yet my real class, It access another class that handle the file write and load. =)

Well, when you finish , please post an idea of what is your solution and why is it that way.

=)

On this forum you have experts like Roel, Perillo, will be pretty hard you get a question without a clear anwser =)

[]s
 
Roel De Nijs
Sheriff
Posts: 10430
133
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Matheus Mendes wrote:On this forum you have experts like Roel, Perillo, will be pretty hard you get a question without a clear anwser =)

Trying to do the best we can
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Roel De Nijs wrote:Trying to do the best we can


And glad to be able to help!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic