Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Access Method
Message
De
22/12/2019 04:26:06
 
 
À
22/12/2019 00:57:26
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Divers
Thread ID:
01672305
Message ID:
01672401
Vues:
54
>>Using his method, when you instantiate any of these textboxes, there are no method calls, no code in the init. It's only these color properties which have goApp.someColor as values - which will be referenced only the first time; the other instances of the same class will inherit the value as it is, without referencing goApp.someColor again. Which is weird and I haven't tested it yet, but I trus Thomas did. There's a simple way to check this - have a goapp.someColor_access method call aStack() function and log its contents. If he's right, there should be just one call (per class, that is), not one for each instance.
>
>In the embolded part, "inherit" is the operation I have not really checked in depth ;-))
>Vfp syntax of "::" is only documented to work for methods, giving you a choice to call the method of specific inheritance level.
>My guess is that during createobject() for each property a value is created and copied to the instance level in vfp.
>
>In Javascript that at least was NOT always the case: there logic followed (follows ??) reading up the prototype tree to find the level where a value was written into property_name - I must refresh that with the newer Property implementation of JS....
>
>Years back at least you could do dirty tricks in Javascript changing the values "read" from one instantiated object by climbing the prototype hierarchy and changing the value in the prototype ;-)
>
>Paranoids needed to call "this.inherited_value_name = this.inherited_value_name" during construction to decouple the value from the prototype - later changes to the prototype would not change the value of already cnstructed objects, only for the objects constructed after prototype alteration, as the JS rule "write aways to the instane" was in place.
>
>@Fabio: have you ever checked/tested in C++ debugger what happens during construction ? Does vfp a copy to the instance level ? Have you ever tried to alter "the piece of memory" representing the class hierarchy in vfp?
>
I don't have time to see what VFP does on the level of C ++ code or assembler.

By guessing VFP does not copy the classes.
VFP copies parent's property values as they are and creates pointers to nested methods.
This GETPEM of parent properties.
If you want access property values without fire _access method, uses GETPEM().

>Chen would probably already know, but most people do not wonder about such internals...
>
>regards
>thomas
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform