• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

What shall Data class really do?

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 2292
3
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Roel De Nijs wrote:Trying to do the best we can



And glad to be able to help!
 
Dinner will be steamed monkey heads with a side of tiny ads.
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic