Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

updateRecord: can it include undelete?

 
Dmitri Christo
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • 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.
 
Alex Belisle Turcot
Ranch Hand
Posts: 516
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Well, actually what you said makes a lot of sense. Better leave it alone...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic