• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

update, delete & create implementation

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know this topic has been repeating showing itself here. But I still need the views from you guys here. My instruction did not mention anything about update(), deleted() & created() implementation. The closest I can find is:

Your data access class must be called "Data.java", must be in a package called "suncertify.db", and must implement the following interface: (The usual DB.java)



and

It must allow the user to book a selected record, updating the database file accordingly.



Other than that, I simply can't find anything whereby I need to implement that 3 methods. I thought of just implementing them in Data.java(of course =D) and thats it. I will just document something like "this method is out of the scope of the assignment given"

What do you guys think?
 
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you don't implement the update method how will you modify the record to show that it's booked?

I would recommend implementing the methods as it doesn't require much code and would support future enhancement to the GUI and also will aid you in creating test files.

Data class method implementation

regards
Jason
 
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello

This is something that terrifies me so much in the assignment wich is the software design.I have been searching and reading about designing the data access module class and i have reached something:

The Data access module itself might be composed of several classes:
1-A seperate class for reading from the file
3-A seperate class for adding records
2-A seperate class for udpating the fil to the file
An perhaps a seperate class that will check if the format of the file is correct (according to the sun specification).
After discussing this issue with many people,many of them gave a link to the following site :
www.math-cs.gordon.edu/courses/cs211/ATMExample/
This is an example of an ATM system that follow the software design principle according to Jaccobson approach.
I am still in doubt that i should in such proceders in the developer exam.
This way the developer exam will not finish.(Software design alone is a huge issue).Actually from the first time i downloaded the assignment i started to have nightmares.
Thanks to all and good luck.
 
Shan Jun Hao
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jason Moors:
If you don't implement the update method how will you modify the record to show that it's booked?

I would recommend implementing the methods as it doesn't require much code and would support future enhancement to the GUI and also will aid you in creating test files.

Data class method implementation

regards
Jason




Hi, sorry I missed out on that. Update will be implemented. Not create and delete.
 
Shan Jun Hao
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Abit confusing here... can someone pls help me.

This is a portion of the delete method from DB.java



I am confused with the phrase:

Deletes a record, making the record number and associated disk storage available for reuse.



I thought this method simply just indicate an invalid flag in the database file? But associated disk storage available for reuse is really confusing me.
 
Jason Moors
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I thought this method simply just indicate an invalid flag in the database file? But associated disk storage available for reuse is really confusing me.



This is nothing to worry about, it simply means that your delete method should indicate that the corresponding bytes in the db file for a record can be reused.

The delete method does not remove the actual record from the file, therefore your create method uses the invalid flag to determine which records have been marked for deletion and therefore can be reused.

i.e. Your create method should loop through the file until a recId is found with an invalid flag is found, then you should write you new record at this point in the file.

regards
Jason
 
Friends help you move. Good friends help you move bodies. This tiny ad will help:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic