Open Source Applications Foundation

[Dev] Read-only data (Re: (db policy) transparent persistence)

Andy Dent Thu, 28 Nov 2002 09:54:17 +0800


At 17:36 -0800 27/11/2002, David McCusker wrote:
>Note some folks might think of another related feature, which isn't quite
>related to the material above. This is permitting the modification of a
>readonly medium by storing the changes in a "patch" file in some other
>medium that supports modification.

I did this in the OOFILE Report Writer when we added the feature to allow
editing of content in the preview window. (So the report-preview behaved
like a giant tabular document, beloved by teachers.)

You could save a report document out to XML, take it home and edit it there
importing into a generic application.

The backend support for content modification in "patch mode" was a
variation of our dirty record caching. OOFILE allows you to set the
database save mode so dirty records in a collection are cached until
explicitly saved (the default for related data, like Order Item Lines which
are saved by a cascaded save from an owning Order).

Adding the SaveForever mode to the cache made the local patches happen
transparently to the rest of the database logic. At closure of a report,
the cache was simply abandoned.
-- 
Andy Dent BSc  MACS  AACM   http://www.oofile.com.au/
OOFILE - Database, Reports, Graphs, GUI for c++ on Mac, Unix & Windows
PP2MFC - PowerPlant->MFC portability