Renaming Attributes

May 5, 2010 at 4:04 AM
Edited May 5, 2010 at 4:09 AM

Hi, I'm curious how other people recommend going about renaming attributes?  I know this is sort of quite possibly/almost certainly not Savant lib related but just thought it would be an interesting topic to open up for discussion =].  I don't see any special Savant lib mechanisms for helping with this but thought I'd pose that question as well while I'm at it... so I'll get that out of the way and ask if there is anything in the lib to help with this that I'm just completely missing?  I would expect there is NOT (but thought it doesn't hurt to ask =])... so moving on from that/as I said originally, I'd expect this is just probably a more general Simple DB discussion... my first obvious thought is just straight up New Attribute, Copy value, Delete old attribute?  Recommendations?

Coordinator
May 5, 2010 at 12:23 PM
Edited May 5, 2010 at 12:27 PM

Putting the attribute values under a new name is really the only option you have. I don't even bother deleting the old attribute from SimpleDB in many cases (depending on the volume of data). Of course, this can get a little tricky when using Savant attributes on your data classes. The approach I recommend is to

  1. Rename the corresponding property on your data class. 
  2. Read the old attribute using a Savant typeless operation.
  3. Write the new attribute using either a typeless operation or the new data class.

By the way, thanks for the kind review--I couldn't send a direct message to thank you because of your Codeplex profile settings.