Standalone - Using stack as DB
ambassador at fourthworld.com
Sat Aug 2 21:15:13 CDT 2008
Scott Morrow wrote:
> I think a common variation is to have a standalone application (which
> most "long-timers" try to put minimal code into), a "program main
> stack" (perhaps with substacks) which can also be a stack file that
> the standalone loads first to establish the interface (and doesn't
> need to be saved), and data files which can also be substacks. Then
> just the data substacks need to be involved with the save process.
> Keeping the data separate from the everything else has been consistent
> advice on this list.
Yep, that's how I work. I've come to love using stack files for data
storage. They give me all the flexibility I've enjoyed with my own
custom formats but I don't need to worry about parsing the file, since
the built-in routines for getting and setting properties make it dirt
simple to stuff any data I need discretely.
Extra bonus points: simply setting the password of the data file makes
the data unreadable to other apps. Sometimes I do this with hard-wired
passwords just for modest on-disk protection. If I need user-managed
security I use either fwPack/fwUnpack
(<http://www.revjournal.com/tutorials/handy-handlers-005.html>) for very
modest security, or Rev's encryption externals for industrial-strength
And a nice extra: in those rare cases when a save is interrupted, the
engine has automatically made a backup of the last good save (the "~*"
copy), which has made a couple of my end-users very happy to learn about. :)
Fourth World Media Corporation
Ambassador at FourthWorld.com http://www.FourthWorld.com
More information about the use-livecode