Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

null values on the update data

 
Cleverson Schmidt
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

From my specs:


Is it ok to interpret a null value on the data array as a request to ignore this value on the update process? I mean, suppose I just want to update the first column from a given record, then I would call update passing the following array:


The update method would change the first column value from the recNo record and the rest would be left untouched.

Do you agree on that interpretation or a NullPointerException is more "normal"?

Thank you
Best Regards
Cleverson
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Cleverson,

I implemented the update method so that each element had to contain some data even if it was only overwriting the same data underneath. My reasoning for this was the following line:

//The new value for field n appears in data[n].


I interpretted this to mean that each element had to contain data. I don't think that doing it your way is necessarily wrong though. As long as you document in your choices.txt your decision to implement the method like so.

Cheers,
Matt.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic