Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copy an Object
Message
 
 
À
16/07/2006 12:41:42
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 7
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01136724
Message ID:
01136794
Vues:
12
Thomas,

Why do you need a copy of the parameter object? You should be able to just keep passing the same one around. If you go copying and forking different versions of the parameter object around to different methods/functions I'd think it'd get hard to know what version of the parameter object is at any point. If the parameter object is not being written to by the destinations then there isn't much reason to not just use the one instance.

It's not that hard to write a clone/serialize/deserialize method in a class hierarchy provided that shallow copy is all you need.

>There is one area I'ld like to have a native clone-method or function: if I have to use standadized parameter objects. A simple "shallow copy" functionality like you described with amembers() should be enough there - the deep copy functionality (cloning of referenced objects) should not be needed.
>
>But if you ever had the "pleasure" of having to write inside a framework having a "halfgod"-like parameter object (and yes, they had god objects as well <g>) as part of the interface you'ld probably feel the need as well.
df (was a 10 time MVP)

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

Click here to load this message in the networking platform