[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ADT Lib (7)



Mike Griebling wrote:
> I think it would be useful to store both.  As an example, if a
> user has entered some data into a string, it would be useful if,
> after shutting down the app and reopening, if that data were
> still present.  In the case of an editor, if a large scrolling
> text region has been filled with text, it would be useful to
> have it restored.

You want to store all VO objects and all models?  This simplifies
things, of course.  But: You have no way to exclude any models
from the external file.  The application needs to call
`WriteObject' on all roots, i.e., any global variable that points
to a model of VO entity.  Adding new roots (e.g. by linking in
another module) would break old files.  And: When I talk about a
application, I mean a linked executable with a fixed number of
known modules.  This approach does not work for a system with
dynamic loading, like ETH's Oberon systems.

>> from a file and dyanmically allocated objects handled (object
>> identification)?  E.g. how do I connect a list model to a
>> loaded list object? As always I
>
> I guess the simplest method of connecting the two would be to
> use some sort of name or id system which can associate the
> flattened entities in files with one another.  For example, a
> pointer to a model would be converted into a store of the model
> data, prefixed with some sort of id.  Instead of storing the
> pointer you would store the model id.  Later, when recovering
> the object data, the models might be read first into some sort
> of holding list, referenced by id, and the links to their
> parents would be restored as the parents are read.  Maybe the
> simplest id you could use would be just to use the memory
> pointer.  It would be guaranteed to be unique and would
> automatically link all the related uses of the model.

This looks suspicously like the general serialization algorithm --
as implemented by module Storage.  Of course, the user does not
need to fuss around with some sort of id himself.

-- mva