Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Serialize/Stream a VFP Object
Message
 
 
À
19/01/1999 04:30:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00177478
Message ID:
00177529
Vues:
32
Albert,

That's how I think I'd handle it. Since we don't have multiple inheritance, I'd use a UDF to simulate it. Give each baseclass a Serialize method that takes an argument indicating if it's a write or read. That method then just does a call to a UDF Serialize( nDirection, this ). The UDF can then either do the work itself, or instantiate a Serialize object and call one of it's methods with the object reference. I'd use an object if you think you might want to alter/extend the serialization process later. You might do a cSerialize class that just defines the interface, then maybe derive cSerializeDBF, cSerializeTXT, cSerializeWhateverDataStore from cSerialize. The derived classes then implement the specifics for each variety.

I've thought about this from time to time, but have never found a need to serialize a whole object. My form class "serializes" it's .Top, .Left, .Height and .Width properties to the registry but I actually do that work with a custom object per property that gets AddObjected to the form at runtime.

>Yes, I thought of that. Do you think it should be implimented through an external function or through an object that is added to the object to be streamed? Without multiple inheritance or interfaces, it is not trivial to add the functionality to preexisting classes. I think that an external function is the easiest to impliment because of the requirement to recurse through the containership heirarchy.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform