• 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

updateRecord: can it include undelete?

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

In my assignment URLyBird 1.2.1, the record is clearly defined by 7 fields: name, location, size, smoking, rate, date, owner. The schema however includes an additional byte numeric "delete flag" in the beginning of each record identifying it as a valid or deleted entry. If I choose not to reuse the space of a previously deleted entry in createRecord() (by adding new entries at the end of the file), does it make sense to provide an undelete functionality in my updateRecord() method?

The instructions say about updateRecord(): "Modifies the fields of a record". So, the deleted flag is not part of the record?

Has anyone implemented a similar undelete functionality for this version of the assignment? The instructions do not say anything about how to handle an entry marked as deleted. Let me know what you think or if I shouldn't deal with "undelete" at all.

Thanks.
 
Ranch Hand
Posts: 516
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Originally posted by Dmitri Christo:
If I choose not to reuse the space of a previously deleted entry in createRecord() (by adding new entries at the end of the file), does it make sense to provide an undelete functionality in my updateRecord() method?



Check you requirements, but for many people, the update method is suppose to throw a "RecordNotFoundException" when the record is "non-existing/deleted".

So, to me it does not make sense. And also, I wouldn't dare developping such additional feature while ignoring a "suggested feature, to reuse deleted record".


The instructions say about updateRecord(): "Modifies the fields of a record". So, the deleted flag is not part of the record?



Correct, I also do not interact with the "delete flag" from my update method, since delete records should be ignored anyway.


Has anyone implemented a similar undelete functionality for this version of the assignment? The instructions do not say anything about how to handle an entry marked as deleted. Let me know what you think or if I shouldn't deal with "undelete" at all.



The way I saw it, was deleted records were really deleted. The only option is to create a new record.

But, again, it leaves room for interpretation and choices.

Regards,
Alex
[ January 23, 2008: Message edited by: Alex Belisle Turcot ]
 
Dmitri Christo
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, actually what you said makes a lot of sense. Better leave it alone...
 
Can you hear that? That's my theme music. I don't know where it comes from. Check under this tiny ad:
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