The standard way to do things under PalmOS has been to edit databases in place. There are two reasons for this. The first is that it gets you thinking about user interfaces the Palm way. Palm user interfaces aren't supposed to have "Save" options, just as Palm apps aren't supposed to have "Exit" options. Rather, the changes one makes should be there--it should be simple and intuitive, so that if the user switches to another app, it is all as it should be. Editing things in place gets one in the right mindset.
The second is to save memory, and this is what you were asking about. PalmOS is designed with in-place editing of databases in mind. It is designed to be stable under such operations. Of course, particular releases may be buggy--the T5's original NVFS implementation for instance--but, still, that way of doing things strikes me as The Right Way, as long as you properly call DmGetRecord() and properly release records. To get around potential NVFS bugs, I lock records if I want the handles to work after a while--this may be paranoid, but I do it. Doing things in a way that uses a small amount of heap will allow for maximum compatibility. There are still users of earlier devices out there, devices with 128 or 256K of heap. Depending on your market, you may not want to support them, but generally I try to make apps run on old devices whenever this can be easily done. -- For information on using the PalmSource Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
