aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes update, delete & create implementation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "update, delete & create implementation" Watch "update, delete & create implementation" New topic
Author

update, delete & create implementation

Shan Jun Hao
Ranch Hand

Joined: May 23, 2006
Posts: 39
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?


SCJP, SCWCD, SCBCD, SCJD (In progress)
Jason Moors
Ranch Hand

Joined: Dec 04, 2001
Posts: 188
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
Khaled Mahmoud
Ranch Hand

Joined: Jul 15, 2006
Posts: 361
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.


SCJP, SCJD,SCWCD,SCDJWS,SCEA 5 MCP-C#, MCP-ASP.NET - http://www.khaledinho.com/
Life is the biggest school
Shan Jun Hao
Ranch Hand

Joined: May 23, 2006
Posts: 39
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

Joined: May 23, 2006
Posts: 39
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

Joined: Dec 04, 2001
Posts: 188
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: update, delete & create implementation