Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
XML in methods
Message
De
17/04/2002 12:46:27
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00645319
Message ID:
00645967
Vues:
23
< This is because it is an extremely unusual issue to want to save huge amounts of data into a class definition. I would suggest that you store the XML in a separate file and have the class' Init read it into the property. This way you can change the XML very easily wihtout needing to touch the class definition. Classes are not a good way to store data, they are intended to define objects and their properties. You can use a text file or the memo field of a table to store the XML stream. If you use a table you can even have different records that have different XML and let the object figure out which one it wants at runtime. >


Jim,

If you're using XML to store data, you don't need 'huge amounts of data' to exceed 255 characters. I wanted to store some formatting information in the class: the appearance of member objects in my UI container class changes according to the value of a parameter. This data so to speak defines the visual aspects (parameterises) of the objects in the container class and I think it would be a justified use of a Class definition.
As you said, I could use an extra table and let the object figure out which record it wants at runtime (cfr. factory pattern) but in a way this smells like mimicking a VCX file.
But ultimately, I think I'll have to settle with the use of two different files. But Hey, a VCX has a VCT counterpart or as Yoda used to say about the Sith (Star Wars Episode I) : "Always two there are..."

Thank you for your time.

Intercontinental greetings,

Mark
If everything seems to be going well, you obviously don't know what the hell is going on !
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform