Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Pass object to method NOT by reference
Message
De
10/07/2016 06:26:02
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
09/07/2016 10:51:38
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8.1
Network:
Windows Server 2012 R2
Database:
Visual FoxPro
Application:
Desktop
Virtual environment:
VMWare
Divers
Thread ID:
01638158
Message ID:
01638184
Vues:
75
>Hi Dragan, nfJson can serialize the most complex object,
>even objects with two dimensional arrays containing objects,
>and collections containing collections and arrays.
>
>Regarding type conversion, it is done automatically ( except for
>specific numeric values like double, float or money , -wich btw are
>rarely used - they'll pass as numeric )
>
>I don't know why there's this specific need for passing an
>object as value, but this is the only solution, and there's no
>significant performance penalty involved, ( unless you
>serialize objects with a high resulting string size )

The troublesome part is when the recipient receives the long complex json and has to create the member objects - it has to look up the .classlib, .class, .parent (to see if it's a member object or an object property, to see whether to use newobject function or newobject method) and then there is a potential mess if any of these are ActiveX or other COM objects. Now if passing these between two processes is the only way to create an object on the other side then it's necessary - I do such things a lot when communicating with, say, a webpage - but inside the same process, going via json is pure overhead. The end result is a clone object, and creating a clone right away, without intermediary conversions to string and back, is much simpler (although with the same decisions about newobject function vs newobject method), and the PEMs can be copied straight, regardless of type.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform