wood burning stoves 2.0*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Create/Delete Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Create/Delete" Watch "Create/Delete" New topic
Author

Create/Delete

Wickes Potgieter
Ranch Hand

Joined: Apr 05, 2002
Posts: 68
Well, I have completed my assignment (thanks to JavaRanch) and will be submitting next week Tuesday and write on Wednesday...

But, I have implemented both create/delete functionality in the data class and am wondering if I should take it out. It does work, but I have not tested it fully. I know people has passed without implementing it. Should I take it out or leave it? Obviously providing an explanation on why I have not implemented it.

Thanks in advance!


Wickes Potgieter<br />SCJP<br />BEA Certified Specialist: Server, Integration, Portal, Tuxedo<br />BEA WebLogic Server 7 Certified Enterprise Developer<br />BEA Certified Architect<br /><a href="http://www.bea.com" target="_blank" rel="nofollow">www.bea.com</a>
Quinn Briggs
Greenhorn

Joined: Sep 17, 2004
Posts: 1
I don't think it hurts to leave it in as long as you are sure that it works correctly. I implemented create/delete in my version and received full marks for data store. Others may feel differently...

Good luck.


QB - SCJP 1.4, SCWCD
Robert Chisholm
Ranch Hand

Joined: Jul 18, 2004
Posts: 69
Makes me curious as to how many people use unit testing tools like JUnit.

If you did, you could spend a few hours writing those test cases and just be done with it.

I ran into a surprising snag the other day in my create() method which my JUnit test picked up. I'd highly recommend testing that method, since it can re-use an existing record, or write past the EOF. And I don't know about anyone else but I used a deleted record collection, so that complicated it further.


SCJP 1.4<br />(WIP) SCJD B&S v2.3.3
Anton Golovin
Ranch Hand

Joined: Jul 02, 2004
Posts: 476
Originally posted by Robert Chisholm:
Makes me curious as to how many people use unit testing tools like JUnit.

If you did, you could spend a few hours writing those test cases and just be done with it.

I ran into a surprising snag the other day in my create() method which my JUnit test picked up. I'd highly recommend testing that method, since it can re-use an existing record, or write past the EOF. And I don't know about anyone else but I used a deleted record collection, so that complicated it further.


Was the snag a peculiar situation when the create method overwrote a seeming valid record after it determined it to be deleted ? I had to write a do-while loop to solve that issue.
[ September 21, 2004: Message edited by: Anton Golovin ]

Anton Golovin (anton.golovin@gmail.com) SCJP, SCJD, SCBCD, SCWCD, OCEJWSD, SCEA/OCMJEA [JEE certs from Sun/Oracle]
Wickes Potgieter
Ranch Hand

Joined: Apr 05, 2002
Posts: 68
Thanks...I will test it again just to make sure...
Robert Chisholm
Ranch Hand

Joined: Jul 18, 2004
Posts: 69
The snag was that I cut and pasted some of my update() code into the create() method, assuming it would work the same. I didn't realize skipByte() wouldn't go past the EOF, so it produced some weird results that I definitely would not have noticed without my test case (ie: writing a record past EOF).

The funny thing is that my current client has tons of flatfiles around that I need to read. But I've never actually had to write to them! Guess you learn something new every day.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Create/Delete