Rule #1: Never save what you don’t have to.

In response to this post, using SharedObjects to store data is useful but can be easily misused.  I have not tried out serialization of objects, so there may be easier solutions to implement, but in my experience, many XML attributes and elements are fairly formalized, except for text areas.

This means that you can represent most XML data with bits: e.g., is this a checkbox or radio area (0|1); are there 4 items in the list or 5 (again, 0|1); which item is selected (use a n-bit array to indicate status, or just save the index # of the active one); etc. Make a bit array that represents your XML data, and then compress all text to use the space well.

Also, take advantage of default settings. If you store a 0 in a bit, have that represent the default value: an empty string in a text area, “submit” for the button text, etc.

No matter what, you definitely want to go beyond the toString() method.  Of course, if you only are ever going to have a little bit of data for each user, then just save the whole XML to a SharedObject.

Rule #2: Don’t do any programming that you don’t have to!

🙂

– 30 –

Advertisements