[DGD]serialisation/deserialisation of mixed data.

Felix A. Croes felix at dworkin.nl
Tue Apr 27 20:56:10 CEST 1999


balduin at uni-paderborn.de wrote:

> I currently have the Problem, that I want to serialize and
> deserialize Data of type mixed. This is easy as long as I 
> use basic dgd types. (int, string, float, array, mapping)
> When dealing with objects I stumble into problems. As I have
> persistent objects in a mysql database (If there is interest
> in the dgd-patches for this contact me), each object has
> it's uniqe ID. The straight forward idea with serialisation
> is to use this ID and mark it with a special character lets
> say #42 to indicate persistent database object 42. This works
> fine in both directions as long as we don't have recursive
> Datastructures e.g. complex inventory structures. As I have
> a hierarchic room structure (rooms containing rooms in their
> inventory) loading the root room, would imply loading the
> complete mud at once. To avoid this I decided to postpone
> loading the true object until a function is called, and want 
> to store a marker denoting the Object Number. I currently
> use an array ({ int ObID, object Ob }), and patched call_other
> to call the second (if exists) or fetch it from the 
> (mysql database) otherwise and execute afterwards. (ugly I know)
> With this serialisation becomes a problem. Since the complete
> array denotes the object. My only idea is to use very ugly
> heuristics to serialize ({ 42, ob-pointer }) to #42. My question
> is: does anybody out there have some smart ideas, how to make
> this type-save ? I think this is the very first situation I 
> really miss typedef and struct in dgd.

I have read the above several times now, but I'm still not even
sure what the question is.  Could you rephrase it in somewhat
more digestable paragraphs?

Regards,
Dworkin

List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list